#include <platform.h>
#include <event.h>
Defines | |
#define | _SVCS_H 1 |
Enumerations | |
enum | SystemSvcsEnum { REBOOT_CNTL = 1, CPUPOWER_CNTL, ROUTESVC_CNTL, SWUPDATE_CNTL, CNTL_COUNT, REBOOT_NOTIFY, ROUTESVC_NOTIFY, SWUPDATE_NOTIFY, NOTIFY_COUNT } |
enum | SvcCmdsEnum { START = 10, STOP } |
enum | RouterSvcCmdsEnum { HOST = 20, ROUTER } |
enum | RouteFlagsEnum { F_NETWORK_JOINED = 1, F_LEFT_NETWORK } |
enum | SwUpdateCmdsEnum { DOWNLOAD_UPDATE = 50, PROBE_UPDATE, REPROGRAM } |
enum | RebootFlagsEnum { F_REBOOT_BY_GW = 0x1, F_REPROGRAM_BY_GW } |
Functions | |
int16_t | svccntl (int16_t svc_enum, uint16_t cmd, void(*svc_handler)(event_t event, void *cbargs, void *context), void *resource, void *context) |
#define _SVCS_H 1 |
enum RebootFlagsEnum |
enum RouteFlagsEnum |
enum RouterSvcCmdsEnum |
enum SvcCmdsEnum |
enum SwUpdateCmdsEnum |
enum SystemSvcsEnum |
Kernel services.
REBOOT_CNTL | Reboot Control. Execute directly. No callback is required. Supported commands: START and STOP. |
CPUPOWER_CNTL | CPU Sleep Control. Execute directly. No callback is required. Supported commands: START and STOP. |
ROUTESVC_CNTL | Route Control to configure if the node should be a router or just a host which does not route traffic from other nodes. Execute directly. No callback is required. Supported commands: HOST and ROUTER. |
SWUPDATE_CNTL | Software Update control. Not supported. Potential commands: PROBE_UPDATE, DOWNLOAD_UPDATE, and REPROGRAM. |
CNTL_COUNT | |
REBOOT_NOTIFY |
|
ROUTESVC_NOTIFY | Route Changes Notification. Bind callback handler to kernel when started. Handler will be fire whenver route changes. The nature of the change is stored in flags field in event_t with values defined in RouteFlagsEnum. Stopping the service removes the handler binding. Supported commands: START and STOP. |
SWUPDATE_NOTIFY | Software Update service. Not supported. Supported commands: PROBE_UPDATE, DOWNLOAD_UPDATE, REPROGRAM, |
NOTIFY_COUNT |
int16_t svccntl | ( | int16_t | svc_enum, | |
uint16_t | cmd, | |||
void(*)(event_t event, void *cbargs, void *context) | svc_handler, | |||
void * | resource, | |||
void * | context | |||
) |
Invoke kernel services or listen for kernel notifications.
[in] | svc_enum | kernel service enumeration name. See SystemSvcsEnum. |
[in] | cmd | commands to invoke the service |
[in] | svc_handler | the continuation callback handler for notification. If NULL is passed here, the call will fail unless cmd is for control and does not require notification. |
[in] | resource | no requirement here. |
[in] | context | user context |
[in] | event | type is SVCCNTL in EventsEnum. subtype is set to cmd. flags field may contain extra information, depending on nature of the cmd. |
[in] | cbargs | return resource in svncntl() |
[in] | context | return context in svncntl() |