HiveMindBridge
|
Functions | |
MessageDTO | createResponseMessage (uint32_t responseId, uint32_t msgSourceId, uint32_t msgDestinationId, UserCallTargetDTO moduleDestination, GenericResponseStatusDTO status, const std::string &ackMessage) |
MessageDTO | createFunctionListLengthResponseMessage (uint32_t responseId, uint32_t msgSourceId, uint32_t msgDestinationId, UserCallTargetDTO moduleDestination, uint32_t length) |
MessageDTO | createFunctionDescriptionResponseMessage (uint32_t responseId, uint32_t msgSourceId, uint32_t msgDestinationId, UserCallTargetDTO moduleDestination, FunctionDescriptionDTO functionDescription) |
MessageDTO | createFunctionCallRequest (uint32_t msgSourceId, uint32_t msgDestinationId, uint32_t requestId, UserCallTargetDTO moduleDestination, const std::string &callbackName, const CallbackArgs &args) |
MessageDTO | createFunctionCallRequest (uint32_t msgSourceId, uint32_t msgDestinationId, uint32_t requestId, UserCallTargetDTO moduleDestination, const std::string &callbackName) |
std::optional< MessageDTO > | createBytesMessage (uint32_t msgSourceId, uint32_t msgDestinationId, uint32_t requestId, uint32_t byteReqId, uint32_t packetNumber, bool lastPacket, uint8_t *payload, uint16_t payloadLength) |
MessageDTO | createGreetMessage () |
uint32_t | generateRandomId () |
Utilitary functions for message creation
std::optional< MessageDTO > MessageUtils::createBytesMessage | ( | uint32_t | msgSourceId, |
uint32_t | msgDestinationId, | ||
uint32_t | requestId, | ||
uint32_t | byteReqId, | ||
uint32_t | packetNumber, | ||
bool | lastPacket, | ||
uint8_t * | payload, | ||
uint16_t | payloadLength | ||
) |
Create a message with a Bytes request. This only creates the message, and does NOT manage the packet numbering logic.
msgSourceId | The ID of this device |
msgDestinationId | The ID of the target device |
requestId | The ID of the request |
byteReqId | The ID of the Bytes request |
packetNumber | The number of this packet |
lastPacket | Whether this is the last packet in the Bytes request |
payload | The section of the payload that constitutes this packet |
payloadLength | The length of the payload that constitutes this packet |
MessageDTO MessageUtils::createFunctionCallRequest | ( | uint32_t | msgSourceId, |
uint32_t | msgDestinationId, | ||
uint32_t | requestId, | ||
UserCallTargetDTO | moduleDestination, | ||
const std::string & | callbackName | ||
) |
Create a message with a Function call request without arguments
msgSourceId | The ID of this device |
msgDestinationId | The ID of the target device |
requestId | The ID of the request |
moduleDestination | The module to send the message to |
callbackName | The name of the function |
MessageDTO MessageUtils::createFunctionCallRequest | ( | uint32_t | msgSourceId, |
uint32_t | msgDestinationId, | ||
uint32_t | requestId, | ||
UserCallTargetDTO | moduleDestination, | ||
const std::string & | callbackName, | ||
const CallbackArgs & | args | ||
) |
Create a message with a Function call request with arguments
msgSourceId | The ID of this device |
msgDestinationId | The ID of the target device |
requestId | The ID of the request |
moduleDestination | The module to send the message to |
callbackName | The name of the function |
args | The args to pass to the function |
MessageDTO MessageUtils::createFunctionDescriptionResponseMessage | ( | uint32_t | responseId, |
uint32_t | msgSourceId, | ||
uint32_t | msgDestinationId, | ||
UserCallTargetDTO | moduleDestination, | ||
FunctionDescriptionDTO | functionDescription | ||
) |
Create a response message for a FunctionDescription request
responseId | Id of the request responded to |
msgSourceId | Source of the response. Should correspond to the ID of this device. |
msgDestinationId | Destination of the response. |
moduleDestination | The module to which the response should be addressed. |
functionDescription | The description of the function |
MessageDTO MessageUtils::createFunctionListLengthResponseMessage | ( | uint32_t | responseId, |
uint32_t | msgSourceId, | ||
uint32_t | msgDestinationId, | ||
UserCallTargetDTO | moduleDestination, | ||
uint32_t | length | ||
) |
Create a response message for a FunctionListLength request
responseId | Id of the request responded to |
msgSourceId | Source of the response. Should correspond to the ID of this device. |
msgDestinationId | Destination of the response. |
moduleDestination | The module to which the response should be addressed. |
length | the length of the function list |
MessageDTO MessageUtils::createGreetMessage | ( | ) |
Create a greet message
MessageDTO MessageUtils::createResponseMessage | ( | uint32_t | responseId, |
uint32_t | msgSourceId, | ||
uint32_t | msgDestinationId, | ||
UserCallTargetDTO | moduleDestination, | ||
GenericResponseStatusDTO | status, | ||
const std::string & | ackMessage | ||
) |
Create a response message containing some parameters
responseId | Id of the request responded to |
msgSourceId | Source of the response. Should correspond to the ID of this device. |
msgDestinationId | Destination of the response. |
moduleDestination | The module to which the response should be addressed. |
status | The status of the processing of the message |
ackMessage | A string containing some details. |
uint32_t MessageUtils::generateRandomId | ( | ) |
Returns a suitable value to use as a requestId;