Link Entity¶
- group LinkEntity
The Link class provides link level access to streaming information.
-
struct linkSpec_CCA¶
CCA linkSpec structure - It contains the necessary information for connecting to a BrainStem module.
Public Members
-
unsigned int type¶
The transport type of this spec.
-
unsigned int serial_num¶
The serial number of the module
-
unsigned int module¶
The module address
-
unsigned int router¶
The BrainStem network router address
-
unsigned int router_serial_num¶
The BrainStem network router serial number
-
unsigned int model¶
The model type
-
unsigned int usb_id¶
The usb_id of the BrainStem module.
-
unsigned int ip_address¶
The IP4 address of the module.
-
unsigned int ip_port¶
The TCP port for socket connection on the module.
-
unsigned int baudrate¶
The serial port baudrate
-
char port[100]¶
The serial port path or name
-
unsigned int type¶
-
struct StreamStatusEntry_CCA¶
StreamStatusEntry structure - It contains members of streaming entries in the form of key value pairs. Keys are comprised of the devices module address, command, option, index, and subindex API values.
-
void link_enableStream(unsigned int *id, struct Result *result, const unsigned char moduleAddress, const unsigned char cmd, const unsigned char option, const unsigned char index, const bool enable)¶
Enables streaming for the supplied criteria.
- Parameters:
id – Unique identifier for the internally created stem.
result – object, containing NO_ERROR or a non zero Error code.
moduleAddress – Address to filter on.
cmd – cmd to filter by (supports Wildcards)
option – option to filter by (supports Wildcards)
index – index to filter by (supports Wildcards)
enable – True - Enables streaming; False - disables streaming
-
void link_getLinkSpecifier(unsigned int *id, struct Result *result, struct linkSpec_CCA *spec)¶
Get linkSpecifier
- Parameters:
id – Unique identifier for the internally created stem.
result – object, containing NO_ERROR or a non zero Error code.
spec – - allocated linkspec struct will be filled with spec.
-
void link_registerStreamCallback(unsigned int *id, struct Result *result, const unsigned char moduleAddress, const unsigned char cmd, const unsigned char option, const unsigned char index, const bool enable, cStreamCallback_t cb, void *pRef)¶
Registers a callback function based on a specific module, cmd, option, and index.
::aErrNotFound - Item not found (uninstalling only)
::aErrNone - success
- Parameters:
id – Unique identifier for the internally created stem.
result – object, containing NO_ERROR or a non zero Error code.
cmd – cmd to filter by (supports Wildcards)
option – option to filter by (supports Wildcards)
index – index to filter by (supports Wildcards)
enable – True - installs/updates callback and ref; False - uninstalls callback
cb – Callback to be executed when a new packet matching the criteria is received.
pRef – Pointer to user reference for use inside the callback function.
-
void link_getStreamStatus(unsigned int *id, struct Result *result, const unsigned char moduleAddress, const unsigned char cmd, const unsigned char option, const unsigned char index, const unsigned char subindex, struct StreamStatusEntry_CCA *buffer, const unsigned int bufferLength)¶
Gets all available stream values based on the search criteria.
::aErrParam if status or unloadedSize is null
::aErrNone - success
- Parameters:
id – Unique identifier for the internally created stem.
result – object, containing NO_ERROR or a non zero Error code.
moduleAddress – Address to filter on (supports Wildcards)
cmd – cmd to filter by (supports Wildcards)
option – option to filter by (supports Wildcards)
index – index to filter by (supports Wildcards)
subindex – subindex to filter by (supports Wildcards)
buffer – Buffer of user allocated memory to be filled with stream data Note: Link::getStreamKeyElement should be used to decode the keys
bufferLength – Number of elements the buffer can hold.
-
void link_getStreamKeyElement(struct Result *result, const unsigned long long key, const unsigned char element)¶
Convenience function to unpack a stream key.
- Parameters:
key – The key to be unpacked
element – The element to unpack from the key.