1#ifndef VITROIO_SDK_NODE_CONTROLLER_H
2#define VITROIO_SDK_NODE_CONTROLLER_H
34#define VITROIO_NODE_CONTROLLER_DEFAULT_EVENT_QUEUE_SIZE 32
94 EventQueue* targetQueue,
127 osPriority priority = osPriorityNormal,
151 osPriority priority = osPriorityNormal,
183 EventQueue* targetQueue,
251 std::function<void(
const CanbusFrame&)> externalFrameCallback;
253 void setNodeId(uint32_t
id);
255 int onFrameReceivedCallbackHandle_;
259 void handleNodeIdResponseFrame(
const CanbusFrame& frame);
261 void handleProvisioningFrame(
const CanbusFrame& frame);
262 void handleExternalFrame(
const CanbusFrame& frame);
264 void onNewFirmwareAvailableCallback();
266 uint64_t getHardwareId();
Class is a wrapper for mbed::CANMessage. It provides interface allowing creation of frames complied w...
Definition: canbus_frame.h:24
Class is a wrapper for mbed::CAN class and provides interface for CanbusFrame type.
Definition: canbus.h:50
Class is a main component of the node firmware.
Definition: node_controller.h:54
uint32_t nodeId()
Function allows to obtain node ID assigned by gateway during initialization of communication.
int initCommunication(uint32_t sync_time, Transport_layer *layer)
Function initializes communication with gateway. This method blocks until the communication is not in...
bool isValid()
Function allows to check whether the controller is in valid state.
NodeController(Canbus *canbus, const FirmwareId &fwId, const Version &fwVersion, osPriority priority=osPriorityNormal, uint32_t eventQueueSize=VITROIO_NODE_CONTROLLER_DEFAULT_EVENT_QUEUE_SIZE)
Contructor initializes the controller and creates internal event loop using thread with priority prio...
NodeController(Canbus *canbus, const FirmwareId &fwId, const Version &fwVersion, FlashSpace environmentFlashSpace, FlashSpace regionAFlashSpace, FlashSpace regionBFlashSpace, osPriority priority=osPriorityNormal, uint32_t eventQueueSize=VITROIO_NODE_CONTROLLER_DEFAULT_EVENT_QUEUE_SIZE)
Contructor initializes the controller and creates internal event loop using thread with priority prio...
NodeController(Canbus *canbus, const FirmwareId &fwId, const Version &fwVersion, FlashSpace environmentFlashSpace, FlashSpace regionAFlashSpace, FlashSpace regionBFlashSpace, EventQueue *targetQueue, uint32_t eventQueueSize=VITROIO_NODE_CONTROLLER_DEFAULT_EVENT_QUEUE_SIZE)
Contructor initializes the controller and chains an internal event queue to the targetQueue.
void setExternalFrameCallback(std::function< void(const CanbusFrame &)>)
Function allows to attach a handler for frames with paramId matching VITROIO_PROTOCOL_EXTERNAL_FRAME.
NodeController(Canbus *canbus, const FirmwareId &fwId, const Version &fwVersion, EventQueue *targetQueue, uint32_t eventQueueSize=VITROIO_NODE_CONTROLLER_DEFAULT_EVENT_QUEUE_SIZE)
Contructor initializes the controller and chains an internal event queue to the targetQueue.
int initCommunication(Transport_layer *layer)
Function initializes communication with gateway. This method blocks until the communication is not in...
Virtual class providing interface for communication interfaces.
Definition: transport_layer.h:29
Class is wrapper for FlashInterface. It allows to read/write environment variables stored in flash me...
Definition: environment_interface.h:33
Class is a wrapper for mbed::FlashIAP module.
Definition: flash_interface.h:26
Definition: scoped_ptr.h:17
Class is responsible for handling upgrade data.
Definition: upgrade_controller.h:39
#define VITROIO_NODE_CONTROLLER_DEFAULT_EVENT_QUEUE_SIZE
Defines default size of internal event queue for NodeController .
Definition: node_controller.h:34
The namespace contains all of components of vitro-shard-sdk and components based on the sdk....
Definition: can_layer.h:9
Structure representing space of flash memory.
Definition: types.h:79
Structure representing version in format major.minor.patch.
Definition: types.h:47
The file contains types used by vitro-shard-sdk.