Properties | |
| NSURL * | baseUrl |
| NSString * | authId |
| NSString * | authPass |
| BOOL | authMaster |
| double | timeout |
| - (CloudPlugsRequest*) controlDeviceWithModel: | (NSString *) | model | |
| ctrl: | (NSString *) | ctrl | |
| password: | (NSString *) | password | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for enrolling an already existent controller device
| model | The model id of the device to control. |
| ctrl | The serial number (hwid) of the device to control. |
| password | The device password's |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) enrollCtrlWithModel: | (NSString *) | model | |
| ctrl: | (NSString *) | ctrl | |
| password: | (NSString *) | password | |
| hwid: | (NSString *) | hwid | |
| name: | (NSString *) | name | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for enrolling a new or already existent controller device.
| model | The model id of the device to control. |
| ctrl | The serial number (hwid) of the device to control. |
| password | The device password's |
| hwid | If not NULL, then set unique string to identify this controller device |
| name | If not NULL, then set the name of this device |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) enrollProductWithModel: | (NSString *) | model | |
| hwid: | (NSString *) | hwid | |
| password: | (NSString *) | password | |
| props: | (NSDictionary *) | props | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for enrolling a new production device.
| model | The device model's. |
| hwid | The serial number. |
| password | The password. |
| props | If not NULL, then initialize the custom properties. |
| handler | Callback function. If not NULL it will receive the Request and its Response |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) enrollPrototypeWithHWid: | (NSString *) | hwid | |
| password: | (NSString *) | password | |
| name: | (NSString *) | name | |
| perm: | (NSDictionary *) | perm | |
| props: | (NSDictionary *) | props | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for enrolling a prototype
| hwid | If NULL, then it will be set as a random unique string. |
| password | If NULL, then set as the X-Plug-Master of the company |
| name | The name of the product. |
| perm | If NULL, then permit all. |
| props | If not NULL, then initialize the custom properties. |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) getChannel: | (NSString *) | channelMask | |
| before: | (id) | before | |
| after: | (id) | after | |
| at: | (id) | at | |
| of: | (id) | of | |
| offset: | (NSInteger) | offset | |
| limit: | (NSInteger) | limit | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for retrieving list channels/channels about already published data
| channelMask | The channel mask. |
| before | : TIMESTAMP || PLUG_ID, Optional, timestamp valid if greater than zero or OID of published data |
| after | : TIMESTAMP || PLUG_ID, Optional, timestamp valid if greater than zero or OID of published data |
| at | : TIMESTAMP_CSV || [TIMESTAMP,...], Optional, timestamp valid if greater than zero //TODO TIMESTAMP_CSV&? |
| of | : "PLUG_ID_CSV" || ["PLUG_ID",...], Optional, plugid cvs |
| offset | : N |
| limit | : N |
| handler | Callback function. If not NULL it will receive the Request and its Response |
| handler | Callback function. If not NULL it will receive the Request and its Response |
| - (CloudPlugsRequest*) getDevice: | (NSString *) | plugid | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for reading a device.
| plugid | The plug-id of the device. |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) getDeviceLocation: | (NSString *) | plugid | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for writing or deleting device location
| plugid | If not NULL, then the plug-id of the device, otherwise the device referenced in the session. |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) getDeviceProp: | (NSString *) | plugid | |
| prop: | (NSString *) | prop | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for reading the device properties
| plugid | The plug-id of the device. |
| prop | If NULL, then all properties value; otherwise the single property value. |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) publishData: | (NSString *) | channel | |
| body: | (id) | body | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for publishing data
| channel | A optional channel, if NULL data need to contain a couple "channel":"channel" |
| body | A json object or an array of objects like this: { "id" : “PLUG_ID”, "channel" : “CHANNEL”, // optional, to override the channel in the url "data" : JSON, "at" : TIMESTAMP, "of" : "PLUG_ID", // optional, check if the X-Plug-Id is authorized for setting this field "is_priv" : BOOLean, // optional, default false "expire_at" : TIMESTAMP, // optional, expire date of this data entry "ttl" : Number // optional, how many seconds this data entry will live (if "expire_at" is present, then this field is ignored) } |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) removeData: | (NSString *) | channelMask | |
| withId: | (id) | _id | |
| before: | (id) | before | |
| after: | (id) | after | |
| at: | (id) | at | |
| of: | (id) | of | |
| limit: | (NSInteger) | limit | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for deleting already published data
| channelMask | The channel mask |
| _id | |
| before | |
| after | |
| at | |
| of | |
| limit | |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) removeDeviceProp: | (NSString *) | plugid | |
| prop: | (NSString *) | prop | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for deleting device property
| plugid | The plug-id of the device. |
| prop | The single property value to be remove. |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) retrieveDataFrom: | (NSString *) | channelMask | |
| before: | (NSDate *) | before | |
| after: | (NSDate *) | after | |
| at: | (NSDate *) | at | |
| of: | (id) | of | |
| offset: | (NSInteger) | offset | |
| limit: | (NSInteger) | limit | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for retrieving already published data
| channelMask | The channel mask. |
| before | Optional, timestamp valid if greater than zero |
| after | Optional, timestamp valid if greater than zero |
| at | Optional, timestamp valid if greater than zero |
| of | Optional, plugid cvs |
| offset | Optional |
| limit | Optional |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) setDevice: | (NSString *) | plugid | |
| perm: | (NSDictionary *) | perm | |
| name: | (NSString *) | name | |
| status: | (NSString *) | status | |
| props: | (NSDictionary *) | props | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for modifying a device
| plugid | The plug-id of the device. |
| perm | : PERM_FILTER, // optional, it contains just the sharing filters to modify |
| name | : String, // optional |
| status | : STATUS, // optional |
| props | : Object // optional, it contains just the properties to modify |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) setDeviceLocation: | (NSString *) | plugid | |
| longitude: | (double) | longitude | |
| latitude: | (double) | latitude | |
| altitude: | (double) | altitude | |
| accuracy: | (double) | accuracy | |
| timestamp: | (NSDate *) | timestamp | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for writing or deleting device location
| plugid | If not NULL, then the plug-id of the device, otherwise the device referenced in the session. |
| longitude | |
| latitude | |
| altitude | |
| accuracy | |
| timestamp | |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) setDeviceProp: | (NSString *) | plugid | |
| prop: | (NSString *) | prop | |
| value: | (id) | value | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for writing or deleting device properties
| plugid | The plug-id of the device. |
| prop | If NULL, then value must be an object; otherwise the single property value is written. |
| value | A json value, use null to delete one or all device properties. |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) uncontrolDeviceWithPlugId: | (NSString *) | plugid | |
| plugid_controlled: | (id) | plugidControlled | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for uncontrolling a device
| plugid | If NULL, then is the plug-id in the session. |
| plugidControlled | If not NULL, then the device(s) to uncontroll (default all associated devices). |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise. | - (CloudPlugsRequest*) unenroll: | (id) | plugid | |
| completionHandler: | (void(^)(CloudPlugsRequest *, CloudPlugsResponse *)) | handler | |
This function performs an HTTP request to the server for removing any device (development, product or controller)
| plugid | The plug-ids csv of the device(s) to remove; if NULL then remove the device referenced in the session. |
| handler | Callback function. If not NULL it will receive the Request and its Response |
TRUE if the request succeeds, FALSE otherwise.
|
readwriteatomicstrong |
The authentication id (plug-id or email) of the session.
|
readwriteatomicassign |
The authentication mode in the session.
|
readwriteatomicstrong |
The authentication password of the session.
|
readwriteatomicstrong |
Base url value for HTTP REST requests.
|
readwriteatomicassign |
Timeout value for requests in the session.