}
/* process the optional 6lowpan headers */
-void lowpan_input(uint8_t* buf, uint8_t len )
+void TRUSTEDBLOCK lowpan_input(uint8_t* buf, uint8_t len )
{
uint8_t *dispatch;
struct lowpan_broadcast_hdr *bc_hdr;
}
/* Receive an AM from the lower layer */
-event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len)
+event TRUSTEDBLOCK message_t* Receive.receive(message_t* msg, void* payload, uint8_t len)
{
am_addr_t am_addr;
\r
interface Crc\r
{\r
- command uint16_t crc16(void* buf, uint8_t len);\r
+ command uint16_t crc16(void* COUNT(len) buf, uint8_t len);\r
}\r
command error_t Init.init()
{
BootArgs bootArgs;
- call IFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+ call IFlash.read(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
// Update the local node ID
if (bootArgs.address != 0xFFFF) {
BootArgs bootArgs;
atomic {
- call IFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+ call IFlash.read(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
if (bootArgs.address != TOS_NODE_ID) {
bootArgs.address = TOS_NODE_ID;
- call IFlash.write((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+ call IFlash.write(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
}
netprog_reboot();
}
}
atomic {
- call IFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+ call IFlash.read(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
bootArgs.imageAddr = reprogramImgAddr;
bootArgs.gestureCount = 0xff;
bootArgs.noReprogram = FALSE;
bootArgs.address = TOS_NODE_ID;
- call IFlash.write((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+ call IFlash.write(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
// reboot
netprog_reboot();
* by newVal is copied out, so newVal can be reclaimed when
* <tt>change</tt> returns.
*/
- command void change(t* newVal);
+ command void change(t* ONE newVal);
}
}
}
/* Used for FE_SENT_MSG, FE_RCV_MSG, FE_FWD_MSG, FE_DST_MSG */
- command error_t CollectionDebug.logEventMsg(uint8_t type, uint16_t msg_id, am_addr_t origin, am_addr_t node) {
+ command error_t TRUSTEDBLOCK CollectionDebug.logEventMsg(uint8_t type, uint16_t msg_id, am_addr_t origin, am_addr_t node) {
statLogReceived++;
if (call MessagePool.empty()) {
return FAIL;
}
}
/* Used for TREE_NEW_PARENT, TREE_ROUTE_INFO */
- command error_t CollectionDebug.logEventRoute(uint8_t type, am_addr_t parent, uint8_t hopcount, uint16_t metric) {
+ command error_t TRUSTEDBLOCK CollectionDebug.logEventRoute(uint8_t type, am_addr_t parent, uint8_t hopcount, uint16_t metric) {
statLogReceived++;
if (call MessagePool.empty()) {
return FAIL;
}
}
/* Used for DBG_2, DBG_3 */
- command error_t CollectionDebug.logEventDbg(uint8_t type, uint16_t arg1, uint16_t arg2, uint16_t arg3) {
+ command TRUSTEDBLOCK error_t CollectionDebug.logEventDbg(uint8_t type, uint16_t arg1, uint16_t arg2, uint16_t arg3) {
statLogReceived++;
if (call MessagePool.empty()) {
return FAIL;
interface CompareBit {
/* should the source of this message be inserted into the neighbor table? */
- event bool shouldInsert(message_t *msg, void* payload, uint8_t len, bool white_bit);
+ event bool shouldInsert(message_t * ONE msg, void* COUNT_NOK(len) payload, uint8_t len, bool white_bit);
}
* of how many times the packet has been transmitted.
*/
typedef struct {
- message_t *msg;
+ message_t * ONE_NOK msg;
uint8_t client;
uint8_t retries;
} fe_queue_entry_t;
its queue entry is pointed to by clientPtrs. */
fe_queue_entry_t clientEntries[CLIENT_COUNT];
- fe_queue_entry_t* clientPtrs[CLIENT_COUNT];
+ fe_queue_entry_t* ONE_NOK clientPtrs[CLIENT_COUNT];
/* The loopback message is for when a collection roots calls
Send.send. Since Send passes a pointer but Receive allows
See sendTask(). */
message_t loopbackMsg;
- message_t* loopbackMsgPtr;
+ message_t* ONE_NOK loopbackMsgPtr;
command error_t Init.init() {
int i;
* message in the pool, it returns the passed message and does not
* put it on the send queue.
*/
- message_t* forward(message_t* m) {
+ message_t* ONE forward(message_t* ONE m) {
if (call MessagePool.empty()) {
dbg("Route", "%s cannot forward, message pool empty.\n", __FUNCTION__);
// send a debug message to the uart
}
- ctp_routing_header_t* getHeader(message_t* m) {
+ ctp_routing_header_t* getHeader(message_t* ONE m) {
return (ctp_routing_header_t*)call BeaconSend.getPayload(m, call BeaconSend.maxPayloadLength());
}
interface CtpRoutingPacket {
/* Allow individual options to be read, set, and reset independently */
- command bool getOption(message_t* msg, ctp_options_t opt);
- command void setOption(message_t* msg, ctp_options_t opt);
- command void clearOption(message_t* msg, ctp_options_t opt);
+ command bool getOption(message_t* ONE msg, ctp_options_t opt);
+ command void setOption(message_t* ONE msg, ctp_options_t opt);
+ command void clearOption(message_t* ONE msg, ctp_options_t opt);
/* Clear all options */
- command void clearOptions(message_t* msg);
+ command void clearOptions(message_t* ONE msg);
- command am_addr_t getParent(message_t* msg);
- command void setParent(message_t* msg, am_addr_t addr);
+ command am_addr_t getParent(message_t* ONE msg);
+ command void setParent(message_t* ONE msg, am_addr_t addr);
- command uint16_t getEtx(message_t* msg);
- command void setEtx(message_t* msg, uint8_t etx);
+ command uint16_t getEtx(message_t* ONE msg);
+ command void setEtx(message_t* ONE msg, uint8_t etx);
}
event error_t start();
event error_t stop();
command void* requestData( uint8_t* size );
- command void storeData( void* data, uint8_t size, uint32_t seqno );
+ command void storeData( void* COUNT(size) data, uint8_t size, uint32_t seqno );
command uint32_t requestSeqno();
event void newData();
}