BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions | Static Public Member Functions
BeeeOn::GWNewDeviceRequest Class Reference

Represents a message sent by the gateway to the server after discovering new device in the sensoric network. More...

#include <GWNewDeviceRequest.h>

Inheritance diagram for BeeeOn::GWNewDeviceRequest:
BeeeOn::GWRequest BeeeOn::GWMessage

Public Types

typedef Poco::SharedPtr
< GWNewDeviceRequest
Ptr
 
- Public Types inherited from BeeeOn::GWRequest
typedef Poco::SharedPtr
< GWRequest
Ptr
 
- Public Types inherited from BeeeOn::GWMessage
typedef Poco::SharedPtr
< GWMessage
Ptr
 

Public Member Functions

 GWNewDeviceRequest (const Poco::JSON::Object::Ptr object)
 
void setDeviceID (const DeviceID &deviceID)
 
DeviceID deviceID () const
 
void setProductName (const std::string &name)
 
std::string productName () const
 
void setVendor (const std::string &vendor)
 
std::string vendor () const
 
void setModuleTypes (const std::list< ModuleType > &types)
 
std::list< ModuleTypemoduleTypes () const
 
void setRefreshTime (const Poco::Timespan &time)
 
Poco::Timespan refreshTime () const
 
void setDeviceDescription (const DeviceDescription &description)
 
DeviceDescription deviceDescription () const
 
- Public Member Functions inherited from BeeeOn::GWRequest
template<typename T >
Poco::SharedPtr< T > derive (std::function< void(Poco::SharedPtr< T >)> f=[](Poco::SharedPtr< T >){}) const
 Derive the appropriate response and apply the given function to construct it.
 
GWResponse::Ptr derive (std::function< void(GWResponse::Ptr)> f=[](GWResponse::Ptr){}) const
 Derive the appropriate response and apply the given function to construct it.
 
- Public Member Functions inherited from BeeeOn::GWMessage
void setID (const GlobalID &id)
 Set unique identifier intended to match request message with its response.
 
GlobalID id () const
 Return unique identifier intended to match request message with its response.
 
GWMessageType type () const
 Returns the type of the message.
 
std::string toString () const
 Returns the string representation of the message.
 
std::string toBriefString () const
 

Static Public Member Functions

static Poco::JSON::Array::Ptr serializeModuleTypes (const std::list< ModuleType > &types)
 
static std::list< ModuleTypeparseModuleTypes (const Poco::JSON::Array::Ptr arrayOfTypes)
 
- Static Public Member Functions inherited from BeeeOn::GWMessage
static GWMessage::Ptr fromJSON (const std::string &json)
 Factory method for creating subclasses of the GWMessage from the json string. More...
 
static GWMessage::Ptr fromJSON (Poco::JSON::Object::Ptr object)
 Factory method for creating subclasses of the GWMessage from the JSON::Object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from BeeeOn::GWRequest
 GWRequest (const GWMessageType::Raw &type)
 
 GWRequest (const Poco::JSON::Object::Ptr object)
 
virtual GWResponse::Ptr deriveResponse () const
 
GWResponse::Ptr deriveGenericResponse (GWResponse::Ptr response) const
 
- Protected Member Functions inherited from BeeeOn::GWMessage
 GWMessage (const GWMessageType::Raw &type)
 Constructs a GWMessage depending on the given type. More...
 
 GWMessage (const Poco::JSON::Object::Ptr object)
 Constructs a GWMessage from the JSON::Object.
 
Poco::JSON::Object::Ptr json () const
 

Detailed Description

Represents a message sent by the gateway to the server after discovering new device in the sensoric network.

The message contains unique device identification, its product name along with vendor, refresh time and types of device modules.

There are some optional properties each device can report about itself. These are currently: "name" (name of the device instance, not product name), "firmware" (string that informs about firmware version), "ip_address", "mac_address", "serial_number".

Response to this request is the generic response GWResponse.

An example message:

{
  "id": "87e63e94-4954-4600-9c37-348c7626d469",
  "message_type": "new_device_request",
  "device_id": "0xa100000000000001",
  "product_name": "Temperature Sensor",
  "vendor": "Brno University of Technology",
  "refresh_time": 30,
  "serial_number": "1234567",
  "firmware": "v125667",
  "module_types": [
     {
       "type": "temperature",
       "attributes": ["inner"]
     },
     {
       "type": "temperature",
       "attributes": ["outer"]
     },
     {
       "type": "battery",
       "attributes": []
     },
     {
       "type": "enum",
       "subtype": "BLINK_MODE",
       "attributes": ["controllable"]
     }
  ]
}

The documentation for this class was generated from the following files: