author
int64 658
755k
| date
stringlengths 19
19
| timezone
int64 -46,800
43.2k
| hash
stringlengths 40
40
| message
stringlengths 5
490
| mods
list | language
stringclasses 20
values | license
stringclasses 3
values | repo
stringlengths 5
68
| original_message
stringlengths 12
491
|
---|---|---|---|---|---|---|---|---|---|
491,595 |
07.11.2018 15:35:57
| -3,600 |
7a587919da0ba8ae1a06ec3d1b0f8e3108621cd1
|
EB can be transmitted to help other motes for synchronizing.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -373,28 +373,6 @@ owerror_t sixtop_send(OpenQueueEntry_t *msg) {\nreturn E_FAIL;\n}\n- if (\n- idmanager_getIsDAGroot() == TRUE ||\n- (\n- idmanager_getIsDAGroot() == FALSE &&\n- icmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n- packetfunctions_sameAddress(&addressToWrite, &msg->l2_nextORpreviousHop)== FALSE\n- )\n- ) {\n- if (schedule_hasAutonomousTxCellToNeighbor(&msg->l2_nextORpreviousHop)==FALSE){\n- moteId = 256*msg->l2_nextORpreviousHop.addr_64b[6]+\\\n- msg->l2_nextORpreviousHop.addr_64b[7];\n- slotoffset = msf_hashFunction_getSlotoffset(moteId);\n- channeloffset = msf_hashFunction_getChanneloffset(moteId);\n- schedule_addActiveSlot(\n- slotoffset, // slot offset\n- CELLTYPE_TX, // type of slot\n- TRUE, // shared?\n- channeloffset, // channel offset\n- &(msg->l2_nextORpreviousHop) // neighbor\n- );\n- }\n- }\n// set metadata\n@@ -737,26 +715,6 @@ port_INLINE void sixtop_sendEB(void) {\nreturn;\n}\n- if (\n- idmanager_getIsDAGroot() == FALSE &&\n- (\n- icmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n- (\n- icmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n- schedule_hasAutonomousTxCellToNeighbor(&addressToWrite) == FALSE\n- )\n- )\n- ){\n- // delete packets genereted by this module (EB and KA) from openqueue\n- openqueue_removeAllCreatedBy(COMPONENT_SIXTOP);\n-\n- // I'm not busy sending an EB or KA\n- sixtop_vars.busySendingEB = FALSE;\n- sixtop_vars.busySendingKA = FALSE;\n-\n- return;\n- }\n-\nif (sixtop_vars.busySendingEB==TRUE) {\n// don't continue if I'm still sending a previous EB\nreturn;\n@@ -871,7 +829,7 @@ port_INLINE void sixtop_sendKA(void) {\nreturn;\n}\n- if (schedule_hasAutonomousTxCellToNeighbor(kaNeighAddr) == FALSE){\n+ if (schedule_hasManagedTxCellToNeighbor(kaNeighAddr) == FALSE){\n// delete packets genereted by this module (EB and KA) from openqueue\nopenqueue_removeAllCreatedBy(COMPONENT_SIXTOP);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. EB can be transmitted to help other motes for synchronizing.
|
491,595 |
07.11.2018 21:07:52
| -3,600 |
eb87c9455b75b9922eba917ba7b1997016fe8948
|
fix the way to get nexthop address.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -443,7 +443,6 @@ void forwarding_receive(\n*/\nvoid forwarding_getNextHop(open_addr_t* destination128b, open_addr_t* addressToWrite64b) {\nuint8_t i;\n- open_addr_t temp_prefix64btoWrite;\nif (packetfunctions_isBroadcastMulticast(destination128b)) {\n// IP destination is broadcast, send to 0xffffffffffffffff\n@@ -451,9 +450,6 @@ void forwarding_getNextHop(open_addr_t* destination128b, open_addr_t* addressToW\nfor (i=0;i<8;i++) {\naddressToWrite64b->addr_64b[i] = 0xff;\n}\n- } else if (neighbors_isStableNeighbor(destination128b)) {\n- // IP destination is 1-hop neighbor, send directly\n- packetfunctions_ip128bToMac64b(destination128b,&temp_prefix64btoWrite,addressToWrite64b);\n} else {\n// destination is remote, send to preferred parent\nicmpv6rpl_getPreferredParentEui64(addressToWrite64b);\n@@ -483,8 +479,17 @@ owerror_t forwarding_send_internal_RoutingTable(\nuint8_t fw_SendOrfw_Rcv\n) {\n+ open_addr_t temp_prefix64btoWrite;\n+\n// retrieve the next hop from the routing table\n+ if (msg->creator==COMPONENT_CJOIN){\n+ if (neighbors_isStableNeighbor(&(msg->l3_destinationAdd))) {\n+ // IP destination is 1-hop neighbor, send directly\n+ packetfunctions_ip128bToMac64b(&(msg->l3_destinationAdd),&temp_prefix64btoWrite,&(msg->l2_nextORpreviousHop));\n+ }\n+ } else {\nforwarding_getNextHop(&(msg->l3_destinationAdd),&(msg->l2_nextORpreviousHop));\n+ }\nif (msg->l2_nextORpreviousHop.type==ADDR_NONE) {\nopenserial_printError(\nCOMPONENT_FORWARDING,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. fix the way to get nexthop address.
|
491,595 |
07.11.2018 21:12:06
| -3,600 |
c758dc2f8cadd08604aed0fc2ba60c1728e8ee8c
|
use txrx autonomous unicast to neighbor(parent) and anycast for rx and downstream traffic.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -954,7 +954,7 @@ port_INLINE void activity_ti1ORri1(void) {\nif (packetfunctions_isBroadcastMulticast(&neighbor)==FALSE){\nif (schedule_getShared()){\n- // this is an autonomous Tx cell\n+ // this is an autonomous TxRx cell (unicast)\nieee154e_vars.dataToSend = openqueue_macGet6PandJoinPacket(&neighbor);\n} else {\n// this is a managed Tx cell\n@@ -971,25 +971,17 @@ port_INLINE void activity_ti1ORri1(void) {\nmsf_updateCellsPassed(&neighbor);\n}\n} else {\n+ if (schedule_getShared()) {\n// this is minimal cell\n- ieee154e_vars.dataToSend = openqueue_macGetDataPacket(&neighbor);\n- if ((ieee154e_vars.dataToSend==NULL) && (cellType==CELLTYPE_TXRX)) {\n- couldSendEB=TRUE;\n- // look for an EB packet in the queue\n- ieee154e_vars.dataToSend = openqueue_macGetEBPacket();\n- } else {\n- // there is a packet to send\n- if (\n- schedule_hasAutonomousTxCellToNeighbor(&ieee154e_vars.dataToSend->l2_nextORpreviousHop)\n- ) {\n- // leave the packet to be sent on autonomous Tx Cell cell and pick up a broadcast packet.\nieee154e_vars.dataToSend = openqueue_macGetDIOPacket();\nif (ieee154e_vars.dataToSend==NULL){\ncouldSendEB=TRUE;\n// look for an EB packet in the queue\nieee154e_vars.dataToSend = openqueue_macGetEBPacket();\n}\n- }\n+ } else {\n+ // this is autonomous TXRX cell (anycast)\n+ ieee154e_vars.dataToSend = openqueue_macGetDownStreamPacket(&neighbor);\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "#include \"idmanager.h\"\n#include \"icmpv6rpl.h\"\n#include \"IEEE802154E.h\"\n+#include \"openqueue.h\"\n//=========================== definition =====================================\n@@ -38,6 +39,8 @@ void msf_housekeeping(void);\nvoid msf_init(void) {\n+ open_addr_t temp_neighbor;\n+\nmemset(&msf_vars,0,sizeof(msf_vars_t));\nmsf_vars.numAppPacketsPerSlotFrame = 0;\nsixtop_setSFcallback(\n@@ -47,12 +50,14 @@ void msf_init(void) {\n(sixtop_sf_handle_callback)msf_handleRCError\n);\n+ memset(&temp_neighbor,0,sizeof(temp_neighbor));\n+ temp_neighbor.type = ADDR_ANYCAST;\nschedule_addActiveSlot(\nmsf_hashFunction_getSlotoffset(256*idmanager_getMyID(ADDR_64B)->addr_64b[6]+idmanager_getMyID(ADDR_64B)->addr_64b[7]), // slot offset\n- CELLTYPE_RX, // type of slot\n+ CELLTYPE_TXRX, // type of slot\nFALSE, // shared?\nmsf_hashFunction_getChanneloffset(256*idmanager_getMyID(ADDR_64B)->addr_64b[6]+idmanager_getMyID(ADDR_64B)->addr_64b[7]), // channel offset\n- idmanager_getMyID(ADDR_64B) // neighbor\n+ &temp_neighbor // neighbor\n);\nmsf_vars.housekeepingTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -549,7 +549,7 @@ void neighbors_setPreferredParent(uint8_t index, bool isPreferred){\n// reserve the autonomous cell to this neighbor\nschedule_addActiveSlot(\nslotoffset, // slot offset\n- CELLTYPE_TX, // type of slot\n+ CELLTYPE_TXRX, // type of slot\nTRUE, // shared?\nchanneloffset, // channel offset\n&(neighbors_vars.neighbors[index].addr_64b) // neighbor\n@@ -557,7 +557,7 @@ void neighbors_setPreferredParent(uint8_t index, bool isPreferred){\n} else {\n// the neighbor is de-selected as parent\n// remove the autonomous cell to this neighbor\n- if (schedule_hasAutonomousTxCellToNeighbor(&(neighbors_vars.neighbors[index].addr_64b))){\n+ if (schedule_hasAutonomousTxRxCellUnicast(&(neighbors_vars.neighbors[index].addr_64b))){\nschedule_removeActiveSlot(\nslotoffset, // slot offset\n&(neighbors_vars.neighbors[index].addr_64b) // neighbor\n@@ -627,7 +627,7 @@ void neighbors_removeOld(void) {\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n(\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n- schedule_hasAutonomousTxCellToNeighbor(&addressToWrite)== FALSE\n+ schedule_hasAutonomousTxRxCellUnicast(&addressToWrite)== FALSE\n)\n) {\nreturn;\n@@ -638,19 +638,17 @@ void neighbors_removeOld(void) {\nif (neighbors_vars.neighbors[i].used==1) {\ntimeSinceHeard = ieee154e_asnDiff(&neighbors_vars.neighbors[i].asn);\nif (timeSinceHeard>DESYNCTIMEOUT) {\n- msf_trigger6pClear(&neighbors_vars.neighbors[i].addr_64b);\n- haveParent = icmpv6rpl_getPreferredParentIndex(&j);\n- if (haveParent && (i==j)) { // this is our preferred parent, carefully!\n- icmpv6rpl_killPreferredParent();\n- icmpv6rpl_updateMyDAGrankAndParentSelection();\n- }\n- // keep the NORES neighbor in the table\nif (\nneighbors_vars.neighbors[i].f6PNORES == FALSE &&\nneighbors_vars.neighbors[i].inBlacklist == FALSE\n){\nremoveNeighbor(i);\n}\n+ haveParent = icmpv6rpl_getPreferredParentIndex(&j);\n+ if (haveParent && (i==j)) { // this is our preferred parent, carefully!\n+ icmpv6rpl_killPreferredParent();\n+ icmpv6rpl_updateMyDAGrankAndParentSelection();\n+ }\n}\n}\n}\n@@ -697,7 +695,7 @@ void registerNewNeighbor(open_addr_t* address,\ni=0;\nwhile(i<MAXNUMNEIGHBORS) {\nif (neighbors_vars.neighbors[i].used==FALSE) {\n- if (rssi < BADNEIGHBORMAXRSSI){\n+ if (rssi < GOODNEIGHBORMINRSSI){\nbreak;\n}\n// add this neighbor\n@@ -765,7 +763,7 @@ void removeNeighbor(uint8_t neighborIndex) {\nneighbors_vars.neighbors[neighborIndex].backoffExponenton = MINBE-1;;\nneighbors_vars.neighbors[neighborIndex].backoff = 0;\n- if (schedule_hasAutonomousTxCellToNeighbor(&(neighbors_vars.neighbors[neighborIndex].addr_64b))){\n+ if (schedule_hasAutonomousTxRxCellUnicast(&(neighbors_vars.neighbors[neighborIndex].addr_64b))){\nmoteId = 256*neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[6]+\\\nneighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[7];\nslotoffset = msf_hashFunction_getSlotoffset(moteId);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -596,7 +596,7 @@ bool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist\nreturn FALSE;\n}\n-bool schedule_hasAutonomousTxCellToNeighbor(open_addr_t* neighbor){\n+bool schedule_hasAutonomousTxRxCellUnicast(open_addr_t* neighbor){\nuint8_t i;\nINTERRUPT_DECLARATION();\n@@ -604,7 +604,7 @@ bool schedule_hasAutonomousTxCellToNeighbor(open_addr_t* neighbor){\nfor(i=0;i<MAXACTIVESLOTS;i++) {\nif(\n- schedule_vars.scheduleBuf[i].type == CELLTYPE_TX &&\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_TXRX &&\nschedule_vars.scheduleBuf[i].shared &&\nschedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\npacketfunctions_sameAddress(neighbor,&schedule_vars.scheduleBuf[i].neighbor)\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -365,7 +365,7 @@ owerror_t sixtop_send(OpenQueueEntry_t *msg) {\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n(\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n- schedule_hasAutonomousTxCellToNeighbor(&addressToWrite)== FALSE\n+ schedule_hasAutonomousTxRxCellUnicast(&addressToWrite)== FALSE\n)\n)\n)\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -183,7 +183,7 @@ OpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void) {\n//======= called by IEEE80215E\n-OpenQueueEntry_t* openqueue_macGetDataPacket(open_addr_t* toNeighbor) {\n+OpenQueueEntry_t* openqueue_macGetDownStreamPacket(open_addr_t* toNeighbor) {\nuint8_t i;\nINTERRUPT_DECLARATION();\nDISABLE_INTERRUPTS();\n@@ -198,7 +198,8 @@ OpenQueueEntry_t* openqueue_macGetDataPacket(open_addr_t* toNeighbor) {\ntoNeighbor->type==ADDR_64B &&\npacketfunctions_sameAddress(toNeighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop)\n) || toNeighbor->type==ADDR_ANYCAST\n- )\n+ ) &&\n+ openqueue_vars.queue[i].l2_sixtop_messageType == SIXTOP_CELL_RESPONSE\n){\nENABLE_INTERRUPTS();\nreturn &openqueue_vars.queue[i];\n@@ -216,15 +217,12 @@ OpenQueueEntry_t* openqueue_macGetDataPacket(open_addr_t* toNeighbor) {\n}\n}\n} else if (toNeighbor->type==ADDR_ANYCAST) {\n- // anycast case: look for a packet which is either not created by RES\n- // or an KA (created by RES, but not broadcast)\n+ // anycast case: look for a packet which is either from openbridge or forwarding component by source routing (ToDo)\nfor (i=0;i<QUEUELENGTH;i++) {\n- if (openqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n- ( openqueue_vars.queue[i].creator!=COMPONENT_SIXTOP ||\n+ if (\n+ openqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n(\n- openqueue_vars.queue[i].creator==COMPONENT_SIXTOP &&\n- packetfunctions_isBroadcastMulticast(&(openqueue_vars.queue[i].l2_nextORpreviousHop))==FALSE\n- )\n+ openqueue_vars.queue[i].creator==COMPONENT_OPENBRIDGE\n)\n) {\nENABLE_INTERRUPTS();\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.h",
"new_path": "openstack/cross-layers/openqueue.h",
"diff": "@@ -42,7 +42,7 @@ bool openqueue_isHighPriorityEntryEnough(void);\nOpenQueueEntry_t* openqueue_sixtopGetSentPacket(void);\nOpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void);\n// called by IEEE80215E\n-OpenQueueEntry_t* openqueue_macGetDataPacket(open_addr_t* toNeighbor);\n+OpenQueueEntry_t* openqueue_macGetDownStreamPacket(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGetEBPacket(void);\nOpenQueueEntry_t* openqueue_macGetKaPacket(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGetDIOPacket(void);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -627,7 +627,7 @@ functionsToChange = [\n'schedule_resetEntry',\n'schedule_getNumberOfFreeEntries',\n'schedule_getNumberOfManagedTxCells',\n- 'schedule_hasAutonomousTxCellToNeighbor',\n+ 'schedule_hasAutonomousTxRxCellUnicast',\n'schedule_hasManagedTxCellToNeighbor',\n'schedule_isNumTxWrapped',\n'schedule_getCellsToBeRelocated',\n@@ -813,7 +813,7 @@ functionsToChange = [\n'openqueue_isHighPriorityEntryEnough',\n'openqueue_sixtopGetSentPacket',\n'openqueue_sixtopGetReceivedPacket',\n- 'openqueue_macGetDataPacket',\n+ 'openqueue_macGetDownStreamPacket',\n'openqueue_macGetEBPacket',\n'openqueue_macGetKaPacket',\n'openqueue_reset_entry',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. use txrx autonomous unicast to neighbor(parent) and anycast for rx and downstream traffic.
|
491,595 |
07.11.2018 22:22:42
| -3,600 |
16193e252bb37948c9303598255843399bfcb1ab
|
configuration that works for opentestbed deployment.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.h",
"new_path": "openstack/02b-MAChigh/neighbors.h",
"diff": "//=========================== define ==========================================\n#define MAXPREFERENCE 2\n-#define BADNEIGHBORMAXRSSI -80 //dBm\n-#define GOODNEIGHBORMINRSSI -90 //dBm\n+#define BADNEIGHBORMAXRSSI -70 //dBm\n+#define GOODNEIGHBORMINRSSI -80 //dBm\n#define SWITCHSTABILITYTHRESHOLD 3\n-#define DEFAULTLINKCOST 4 // this value has too be no greater than 6, when MAXEB is 4 and MAXRETRIES is 4\n+#define DEFAULTLINKCOST 8 // this value has too be no greater than 6, when MAXEB is 4 and MAXRETRIES is 4\n#define MINIMAL_NUM_TX 16\n#define MAXDAGRANK 0xffff\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -26,8 +26,6 @@ The superframe reappears over time and can be arbitrarily long.\n#define SCHEDULE_MINIMAL_6TISCH_DEFAULT_SLOTFRAME_HANDLE 0 //id of slotframe\n#define SCHEDULE_MINIMAL_6TISCH_DEFAULT_SLOTFRAME_NUMBER 1 //1 slotframe by default.\n-#define NUMSERIALRX 3\n-\n/*\nNUMSLOTSOFF is the max number of cells that the mote can add into schedule,\nbesides 6TISCH_ACTIVE_CELLS and NUMSERIALRX Cell. Initially those cells are\n@@ -39,7 +37,7 @@ The superframe reappears over time and can be arbitrarily long.\nfor serial port to transmit data to dagroot.\n*/\n-#define NUMSLOTSOFF 10\n+#define NUMSLOTSOFF 20\n/**\n\\brief Maximum number of active slots in a superframe.\n@@ -51,7 +49,7 @@ in that table; a slot is \"active\" when it is not of type CELLTYPE_OFF.\nSet this number to the exact number of active slots you are planning on having\nin your schedule, so not to waste RAM.\n*/\n-#define MAXACTIVESLOTS 11\n+#define MAXACTIVESLOTS SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS+NUMSLOTSOFF\n/**\n\\brief Minimum backoff exponent.\n@@ -183,7 +181,7 @@ uint8_t schedule_getNumberOfFreeEntries(void);\nuint8_t schedule_getNumberOfManagedTxCells(open_addr_t* neighbor);\nbool schedule_isNumTxWrapped(open_addr_t* neighbor);\nbool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist);\n-bool schedule_hasAutonomousTxCellToNeighbor(open_addr_t* neighbor);\n+bool schedule_hasAutonomousTxRxCellUnicast(open_addr_t* neighbor);\nbool schedule_hasManagedTxCellToNeighbor(open_addr_t* neighbor);\n// from IEEE802154E\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. configuration that works for opentestbed deployment.
|
491,595 |
07.11.2018 22:33:36
| -3,600 |
451569015f3094d9b5cb9b3f18e32efbcfc982a5
|
Fix the warning and macpong projects.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -352,8 +352,6 @@ owerror_t sixtop_request(\nowerror_t sixtop_send(OpenQueueEntry_t *msg) {\n- uint16_t slotoffset, moteId;\n- uint8_t channeloffset;\nopen_addr_t addressToWrite;\nif (\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/03oos_macpong/03oos_macpong.c",
"new_path": "projects/common/03oos_macpong/03oos_macpong.c",
"diff": "@@ -67,7 +67,7 @@ void macpong_initSend(opentimers_id_t id) {\n}\nif (ieee154e_isSynch()==TRUE && neighbors_getNumNeighbors()==1) {\nneighbors_getNeighborEui64(&temp,ADDR_64B,0);\n- if (schedule_hasDedicatedCellToNeighbor(&temp)){\n+ if (schedule_hasManagedTxCellToNeighbor(&temp)){\nif (timeToSend){\n// send packet\nmacpong_send(0);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. Fix the warning and macpong projects.
|
491,595 |
08.11.2018 19:05:03
| -3,600 |
f2f56a2dd444d0b66d1892aa656a90de835dfc84
|
fix the minimal join process.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "@@ -311,6 +311,7 @@ typedef struct {\nuint16_t max_delay; // Max delay in milliseconds before which the packet should be delivered to the receiver\nbool orgination_time_flag;\nbool drop_flag;\n+ bool is_cjoin_response;\n//l4\nuint8_t l4_protocol; // l4 protocol to be used\nbool l4_protocol_compressed; // is the l4 protocol header compressed?\n@@ -321,6 +322,7 @@ typedef struct {\n//l3\nopen_addr_t l3_destinationAdd; // 128b IPv6 destination (down stack)\nopen_addr_t l3_sourceAdd; // 128b IPv6 source address\n+ bool l3_useSourceRouting; // TRUE when the packet goes downstream\n//l2\nowerror_t l2_sendDoneError; // outcome of trying to send this packet\nopen_addr_t l2_nextORpreviousHop; // 64b IEEE802.15.4 next (down stack) or previous (up) hop address\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -150,6 +150,7 @@ owerror_t cjoin_receive(OpenQueueEntry_t* msg,\n// set the L2 keys as per the parsed value\nIEEE802154_security_setBeaconKey(configuration.keyset.key[0].key_index, configuration.keyset.key[0].key_value);\nIEEE802154_security_setDataKey(configuration.keyset.key[0].key_index, configuration.keyset.key[0].key_value);\n+ neighbor_removeAutonomousTxRxCellUnicast(&(msg->l2_nextORpreviousHop));\ncjoin_setIsJoined(TRUE); // declare join is over\nreturn E_SUCCESS;\n} else {\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/opencoap/opencoap.c",
"new_path": "openapps/opencoap/opencoap.c",
"diff": "@@ -1105,6 +1105,9 @@ void opencoap_handle_stateless_proxy(OpenQueueEntry_t *msg,\nif (statelessProxy->length < 8) {\nreturn;\n}\n+\n+ msg->is_cjoin_response = TRUE;\n+\neui64.type = ADDR_64B;\nmemcpy(eui64.addr_64b, statelessProxy->pValue, 8);\n@@ -1211,6 +1214,7 @@ void opencoap_forward_message(OpenQueueEntry_t *msg,\n// take ownership over that packet and set destination IP and port\noutgoingPacket->creator = COMPONENT_OPENCOAP;\noutgoingPacket->owner = COMPONENT_OPENCOAP;\n+ outgoingPacket->is_cjoin_response = msg->is_cjoin_response;\noutgoingPacket->l4_destination_port = destPortNumber;\noutgoingPacket->l3_destinationAdd.type = ADDR_128B;\nmemcpy(outgoingPacket->l3_destinationAdd.addr_128b,destIP->addr_128b,16);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -117,16 +117,37 @@ open_addr_t* neighbors_getJoinProxy(void) {\nuint8_t joinPrioMinimum;\nopen_addr_t* joinProxy;\n+ uint16_t moteId;\n+ uint16_t slotoffset;\n+ uint8_t channeloffset;\n+\njoinPrioMinimum = 0xff;\njoinProxy = NULL;\nfor (i=0;i<MAXNUMNEIGHBORS;i++) {\n- if (neighbors_vars.neighbors[i].used==TRUE &&\n+ if (\n+ neighbors_vars.neighbors[i].used==TRUE &&\nneighbors_vars.neighbors[i].stableNeighbor==TRUE &&\n- neighbors_vars.neighbors[i].joinPrio <= joinPrioMinimum) {\n+ neighbors_vars.neighbors[i].joinPrio <= joinPrioMinimum\n+ ) {\njoinProxy = &(neighbors_vars.neighbors[i].addr_64b);\njoinPrioMinimum = neighbors_vars.neighbors[i].joinPrio;\n}\n}\n+\n+ if (joinProxy){\n+ moteId = 256*joinProxy->addr_64b[6]+joinProxy->addr_64b[7];\n+ slotoffset = msf_hashFunction_getSlotoffset(moteId);\n+ channeloffset = msf_hashFunction_getChanneloffset(moteId);\n+ // reserve the autonomous cell to joinproxy\n+ schedule_addActiveSlot(\n+ slotoffset, // slot offset\n+ CELLTYPE_TXRX, // type of slot\n+ TRUE, // shared?\n+ channeloffset, // channel offset\n+ joinProxy // neighbor\n+ );\n+ }\n+\nreturn joinProxy;\n}\n@@ -566,6 +587,20 @@ void neighbors_setPreferredParent(uint8_t index, bool isPreferred){\n}\n}\n+void neighbor_removeAutonomousTxRxCellUnicast(open_addr_t* address){\n+\n+ uint16_t moteId;\n+ uint16_t slotoffset;\n+\n+ moteId = 256*address->addr_64b[6]+address->addr_64b[7];\n+ slotoffset = msf_hashFunction_getSlotoffset(moteId);\n+\n+ schedule_removeActiveSlot(\n+ slotoffset, // slot offset\n+ address // neighbor\n+ );\n+}\n+\n//===== managing routing info\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.h",
"new_path": "openstack/02b-MAChigh/neighbors.h",
"diff": "@@ -69,6 +69,7 @@ uint8_t neighbors_getSequenceNumber(open_addr_t* address);\nvoid neighbors_setNeighborRank(uint8_t index, dagrank_t rank);\nvoid neighbors_setNeighborNoResource(open_addr_t* address);\nvoid neighbors_setPreferredParent(uint8_t index, bool isPreferred);\n+void neighbor_removeAutonomousTxRxCellUnicast(open_addr_t* address);\n// interrogators\nbool neighbors_isStableNeighbor(open_addr_t* address);\nbool neighbors_isStableNeighborByIndex(uint8_t index);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -482,7 +482,10 @@ owerror_t forwarding_send_internal_RoutingTable(\nopen_addr_t temp_prefix64btoWrite;\n// retrieve the next hop from the routing table\n- if (msg->creator==COMPONENT_CJOIN){\n+ if (\n+ msg->is_cjoin_response ||\n+ msg->creator==COMPONENT_CJOIN\n+ ){\nif (neighbors_isStableNeighbor(&(msg->l3_destinationAdd))) {\n// IP destination is 1-hop neighbor, send directly\npacketfunctions_ip128bToMac64b(&(msg->l3_destinationAdd),&temp_prefix64btoWrite,&(msg->l2_nextORpreviousHop));\n@@ -490,6 +493,7 @@ owerror_t forwarding_send_internal_RoutingTable(\n} else {\nforwarding_getNextHop(&(msg->l3_destinationAdd),&(msg->l2_nextORpreviousHop));\n}\n+\nif (msg->l2_nextORpreviousHop.type==ADDR_NONE) {\nopenserial_printError(\nCOMPONENT_FORWARDING,\n@@ -832,6 +836,8 @@ owerror_t forwarding_send_internal_SourceRouting(\nRH3_length = 0;\n}\n+ msg->l3_useSourceRouting = TRUE;\n+\n// send to next lower layer\nreturn iphc_sendFromForwarding(\nmsg,\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -217,12 +217,14 @@ OpenQueueEntry_t* openqueue_macGetDownStreamPacket(open_addr_t* toNeighbor) {\n}\n}\n} else if (toNeighbor->type==ADDR_ANYCAST) {\n- // anycast case: look for a packet which is either from openbridge or forwarding component by source routing (ToDo)\n+ // anycast case: look for a packet which is either from openbridge or forwarding component by source routing\nfor (i=0;i<QUEUELENGTH;i++) {\nif (\nopenqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n(\n- openqueue_vars.queue[i].creator==COMPONENT_OPENBRIDGE\n+ openqueue_vars.queue[i].creator==COMPONENT_OPENBRIDGE ||\n+ openqueue_vars.queue[i].l3_useSourceRouting == TRUE ||\n+ openqueue_vars.queue[i].is_cjoin_response\n)\n) {\nENABLE_INTERRUPTS();\n@@ -379,12 +381,14 @@ void openqueue_reset_entry(OpenQueueEntry_t* entry) {\nentry->owner = COMPONENT_NULL;\nentry->payload = &(entry->packet[127 - IEEE802154_SECURITY_TAG_LEN]); // Footer is longer if security is used\nentry->length = 0;\n+ entry->is_cjoin_response = FALSE;\n//l4\nentry->l4_protocol = IANA_UNDEFINED;\nentry->l4_protocol_compressed = FALSE;\n//l3\nentry->l3_destinationAdd.type = ADDR_NONE;\nentry->l3_sourceAdd.type = ADDR_NONE;\n+ entry->l3_useSourceRouting = FALSE;\n//l2\nentry->l2_nextORpreviousHop.type = ADDR_NONE;\nentry->l2_frameType = IEEE154_TYPE_UNDEFINED;\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -629,6 +629,7 @@ functionsToChange = [\n'schedule_getNumberOfManagedTxCells',\n'schedule_hasAutonomousTxRxCellUnicast',\n'schedule_hasManagedTxCellToNeighbor',\n+ 'neighbor_removeAutonomousTxRxCellUnicast',\n'schedule_isNumTxWrapped',\n'schedule_getCellsToBeRelocated',\n'schedule_getOneCellAfterOffset',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. fix the minimal join process.
|
491,595 |
09.11.2018 10:36:07
| -3,600 |
89f697e821880b5363d791e69f9a6a2dcfcb6663
|
remove previous installed autonomous cell before sending join request.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -135,6 +135,8 @@ open_addr_t* neighbors_getJoinProxy(void) {\n}\nif (joinProxy){\n+ // remove all previous installed autonomous cell\n+ neighbor_removeAllAutonomousTxRxCellUnicast();\nmoteId = 256*joinProxy->addr_64b[6]+joinProxy->addr_64b[7];\nslotoffset = msf_hashFunction_getSlotoffset(moteId);\nchanneloffset = msf_hashFunction_getChanneloffset(moteId);\n@@ -601,6 +603,11 @@ void neighbor_removeAutonomousTxRxCellUnicast(open_addr_t* address){\n);\n}\n+void neighbor_removeAllAutonomousTxRxCellUnicast(void){\n+\n+ schedule_removeAllAutonomousTxRxCellUnicast();\n+}\n+\n//===== managing routing info\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.h",
"new_path": "openstack/02b-MAChigh/neighbors.h",
"diff": "@@ -70,6 +70,7 @@ void neighbors_setNeighborRank(uint8_t index, dagrank_t rank);\nvoid neighbors_setNeighborNoResource(open_addr_t* address);\nvoid neighbors_setPreferredParent(uint8_t index, bool isPreferred);\nvoid neighbor_removeAutonomousTxRxCellUnicast(open_addr_t* address);\n+void neighbor_removeAllAutonomousTxRxCellUnicast(void);\n// interrogators\nbool neighbors_isStableNeighbor(open_addr_t* address);\nbool neighbors_isStableNeighborByIndex(uint8_t index);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -462,18 +462,36 @@ bool schedule_isSlotOffsetAvailable(uint16_t slotOffset){\nreturn TRUE;\n}\n-void schedule_removeAllCells(\n+void schedule_removeAllCellsToNeighbor(\nuint8_t slotframeID,\n- open_addr_t* previousHop\n+ open_addr_t* neighbor\n){\nuint8_t i;\n// remove all entries in schedule with previousHop address\nfor(i=0;i<MAXACTIVESLOTS;i++){\n- if (packetfunctions_sameAddress(&(schedule_vars.scheduleBuf[i].neighbor),previousHop)){\n+ if (packetfunctions_sameAddress(&(schedule_vars.scheduleBuf[i].neighbor),neighbor)){\n+ schedule_removeActiveSlot(\n+ schedule_vars.scheduleBuf[i].slotOffset,\n+ neighbor\n+ );\n+ }\n+ }\n+}\n+\n+void schedule_removeAllAutonomousTxRxCellUnicast(void){\n+ uint8_t i;\n+\n+ // remove all entries in schedule with previousHop address\n+ for(i=0;i<MAXACTIVESLOTS;i++){\n+ if (\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_TXRX &&\n+ schedule_vars.scheduleBuf[i].shared &&\n+ schedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B\n+ ){\nschedule_removeActiveSlot(\nschedule_vars.scheduleBuf[i].slotOffset,\n- previousHop\n+ &(schedule_vars.scheduleBuf[i].neighbor)\n);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -172,10 +172,11 @@ owerror_t schedule_removeActiveSlot(\nslotOffset_t slotOffset,\nopen_addr_t* neighbor\n);\n+void schedule_removeAllAutonomousTxRxCellUnicast(void);\nbool schedule_isSlotOffsetAvailable(uint16_t slotOffset);\n-void schedule_removeAllCells(\n+void schedule_removeAllCellsToNeighbor(\nuint8_t slotframeID,\n- open_addr_t* previousHop\n+ open_addr_t* neighbor\n);\nuint8_t schedule_getNumberOfFreeEntries(void);\nuint8_t schedule_getNumberOfManagedTxCells(open_addr_t* neighbor);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -883,7 +883,7 @@ void timer_sixtop_six2six_timeout_fired(void) {\nif (sixtop_vars.six2six_state == SIX_STATE_WAIT_CLEARRESPONSE){\n// no response for the 6p clear, just clear locally\n- schedule_removeAllCells(\n+ schedule_removeAllCellsToNeighbor(\nsixtop_vars.cb_sf_getMetadata(),\n&sixtop_vars.neighborToClearCells\n);\n@@ -980,7 +980,7 @@ void sixtop_six2six_sendDone(OpenQueueEntry_t* msg, owerror_t error){\n}\nif ( msg->l2_sixtop_command == IANA_6TOP_CMD_CLEAR){\n- schedule_removeAllCells(\n+ schedule_removeAllCellsToNeighbor(\nmsg->l2_sixtop_frameID,\n&(msg->l2_nextORpreviousHop)\n);\n@@ -1540,7 +1540,7 @@ void sixtop_six2six_notifyReceive(\n);\nbreak;\ncase SIX_STATE_WAIT_CLEARRESPONSE:\n- schedule_removeAllCells(\n+ schedule_removeAllCellsToNeighbor(\nsixtop_vars.cb_sf_getMetadata(),\n&(pkt->l2_nextORpreviousHop)\n);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "#include \"idmanager.h\"\n#include \"opentimers.h\"\n#include \"IEEE802154E.h\"\n+#include \"IEEE802154_security.h\"\n#include \"schedule.h\"\n#include \"msf.h\"\n@@ -265,6 +266,11 @@ void icmpv6rpl_receive(OpenQueueEntry_t* msg) {\n// stop here if I'm in the DAG root\nbreak; // break, don't return\n}\n+\n+ if (IEEE802154_security_isConfigured()==FALSE) {\n+ // this DIO is not able to be parsed if the mote is not secure yet\n+ break;\n+ }\n// update routing info for that neighbor\nicmpv6rpl_indicateRxDIO(msg);\n@@ -376,8 +382,6 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\ndagrank_t neighborRank;\nuint32_t tentativeDAGrank;\n- open_addr_t addressToWrite;\n-\n// if I'm a DAGroot, my DAGrank is always MINHOPRANKINCREASE\nif ((idmanager_getIsDAGroot())==TRUE) {\n// the dagrank is not set through setting command, set rank to MINHOPRANKINCREASE here\n@@ -473,8 +477,6 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\nneighbors_setPreferredParent(prevParentIndex, FALSE);\n// set neighbors as preferred parent\nneighbors_setPreferredParent(icmpv6rpl_vars.ParentIndex, TRUE);\n- // get prepare parent address\n- neighbors_getNeighborEui64(&addressToWrite,ADDR_64B,prevParentIndex);\n}\n}\n} else {\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -612,6 +612,8 @@ functionsToChange = [\n'schedule_isSlotOffsetAvailable',\n'schedule_statistic_poorLinkQuality',\n'schedule_removeAllCells',\n+ 'schedule_removeAllCellsToNeighbor',\n+ 'schedule_removeAllAutonomousTxRxCellUnicast',\n'schedule_syncSlotOffset',\n'schedule_advanceSlot',\n'schedule_getNextActiveSlotOffset',\n@@ -630,6 +632,7 @@ functionsToChange = [\n'schedule_hasAutonomousTxRxCellUnicast',\n'schedule_hasManagedTxCellToNeighbor',\n'neighbor_removeAutonomousTxRxCellUnicast',\n+ 'neighbor_removeAllAutonomousTxRxCellUnicast',\n'schedule_isNumTxWrapped',\n'schedule_getCellsToBeRelocated',\n'schedule_getOneCellAfterOffset',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. remove previous installed autonomous cell before sending join request.
|
491,595 |
09.11.2018 11:01:18
| -3,600 |
053e27578018ceab42b154b629d9f9a663fc33d4
|
use the two parameter for NO_NEXTHOP error information to indicate the destination mote.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "@@ -196,7 +196,7 @@ enum {\nERR_UNEXPECTED_DAO = 0x0a, // unexpected DAO (code location {0}). A change maybe happened on dagroot node.\nERR_UNSUPPORTED_ICMPV6_TYPE = 0x0b, // unsupported ICMPv6 type {0} (code location {1})\nERR_6LOWPAN_UNSUPPORTED = 0x0c, // unsupported 6LoWPAN parameter {1} at location {0}\n- ERR_NO_NEXTHOP = 0x0d, // no next hop\n+ ERR_NO_NEXTHOP = 0x0d, // no next hop for layer 3 destination {0:x}{1:x}\nERR_INVALID_PARAM = 0x0e, // invalid parameter\nERR_INVALID_FWDMODE = 0x0f, // invalid forward mode\nERR_LARGE_DAGRANK = 0x10, // large DAGrank {0}, set to {1}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -498,8 +498,8 @@ owerror_t forwarding_send_internal_RoutingTable(\nopenserial_printError(\nCOMPONENT_FORWARDING,\nERR_NO_NEXTHOP,\n- (errorparameter_t)0,\n- (errorparameter_t)0\n+ (errorparameter_t)msg->l3_destinationAdd.addr_128b[6],\n+ (errorparameter_t)msg->l3_destinationAdd.addr_128b[7]\n);\nreturn E_FAIL;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. use the two parameter for NO_NEXTHOP error information to indicate the destination mote.
|
491,595 |
28.11.2018 10:17:01
| -3,600 |
166ff2747747ebdce7d53f918f532e76cd33580f
|
Update at86rf215 configuration files.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.h",
"new_path": "bsp/chips/at86rf215/at86rf215.h",
"diff": "@@ -3994,7 +3994,7 @@ static const registerSetting_t basic_settings_fsk_option1 []={\n{RG_RF09_PAC, 0x7F},// 0x7F=> bit6-5(0b11): No power amplifier current reduction (max. transmit small signal gain) bit 4-0(0b11111): maxmium tx power\n{RG_BBC0_IRQM, 0x1F},// TXFE, RXEM, RXAM, RXFE, RXFS interrupts enabled\n{RG_BBC1_IRQM, 0x00},\n- {RG_BBC0_PC, 0x1D},// No FCS filter, 32 bits FCS, FSK.\n+ {RG_BBC0_PC, 0x15},// No FCS filter, 32 bits FCS, FSK.\n{RG_BBC0_FSKDM, 0x01},// Direct modulation and preemphasis enabled.\n{RG_BBC0_FSKC0, 0xD6},\n{RG_BBC0_FSKC1, 0x00},\n@@ -4142,6 +4142,27 @@ static const registerSetting_t basic_settings_oqpsk_rate4[] = {\n{RG_RF09_TXDFE, 0x7A}, // .SR = 0xA, .RCUT = 3\n{RG_RF09_PAC, 0x64},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F.\n};\n+\n+static const registerSetting_t basic_settings_oqpsk_250kpbs[] = {\n+ (RG_BBC1_PC, 0x1F),\n+ (RG_BBC1_OQPSKPHRTX, 0x09), // QPSK - legacy\n+ (RG_BBC1_OQPSKC0, 0x03), // 2000 kchips/s\n+ (RG_BBC1_OQPSKC1, 0x47), // MINIMUM preamble-detection sensitivities, rx-override enabled\n+ (RG_BBC1_OQPSKC2, 0x05), // FCS type legacy (16bit) & listen for LEG-OQPSK frames only\n+ (RG_BBC1_OQPSKC3, 0x00), // legacy OQPSK, search for SFD_1 only\n+ (RG_BBC0_IRQM, 0x00), // TXFE, RXFE, RXFS interrupts enabled\n+ (RG_BBC1_IRQM, 0x13), // TXFE, RXFE, RXFS interrupts enabled\n+ (RG_RF09_IRQM, 0x00), // TRXERR, TRXRDY interrupts enabled\n+ (RG_RF24_IRQM, 0x12), // TRXERR, TRXRDY interrupts enabled\n+ (RG_RF24_RXBWC, 0x0B), // Rx BW 2000kHz, IF 2000kHz\n+ (RG_RF24_RXDFE, 0x41), //\n+ (RG_RF24_AGCC, 0x01),\n+ (RG_RF24_EDD, 0x13),\n+ (RG_RF24_AGCS, 0x77),\n+ (RG_RF24_TXCUTC, 0x0B), // .PARAMP = 3, .LPFCUT = 7\n+ (RG_RF24_TXDFE, 0x81), // .SR = 0xA, .RCUT = 3\n+ (RG_RF24_PAC, 0x7F)], // Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F. # 0x15~8dBm\n+}\n//------------------------------------ OFDM -----------------------------------//\n/** Preferred settings for OFDM */\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Update at86rf215 configuration files.
|
491,595 |
28.11.2018 12:14:07
| -3,600 |
1ad7358b477ba7aa3c07e245e6e8927e54bc2c21
|
Update 01bsp_radio_rx and 01bsp_radio_tx projects.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.h",
"new_path": "bsp/chips/at86rf215/at86rf215.h",
"diff": "@@ -3998,13 +3998,13 @@ static const registerSetting_t basic_settings_fsk_option1 []={\n{RG_BBC0_FSKDM, 0x01},// Direct modulation and preemphasis enabled.\n{RG_BBC0_FSKC0, 0xD6},\n{RG_BBC0_FSKC1, 0x00},\n- {RG_BBC0_FSKC2, 0x40},\n+ {RG_BBC0_FSKC2, 0x41},\n{RG_BBC0_FSKC3, 0x85},\n- {RG_BBC0_FSKC4, 0x00}, //FEC disabled. IEEE MODE\n+ {RG_BBC0_FSKC4, 0x0A}, //FEC enable. IEEE MODE\n{RG_BBC0_FSKPE0, 0x02},\n{RG_BBC0_FSKPE1, 0x03},\n{RG_BBC0_FSKPE2, 0xFC},\n- {RG_BBC0_FSKPHRTX, 0x08},// No data whitening SFD0 used.\n+ {RG_BBC0_FSKPHRTX, 0x00}, // if FEC is enable, SFD0 is used, according to JM\n};\nstatic const registerSetting_t basic_settings_fsk_option2 []={\n@@ -4144,25 +4144,25 @@ static const registerSetting_t basic_settings_oqpsk_rate4[] = {\n};\nstatic const registerSetting_t basic_settings_oqpsk_250kpbs[] = {\n- (RG_BBC1_PC, 0x1F),\n- (RG_BBC1_OQPSKPHRTX, 0x09), // QPSK - legacy\n- (RG_BBC1_OQPSKC0, 0x03), // 2000 kchips/s\n- (RG_BBC1_OQPSKC1, 0x47), // MINIMUM preamble-detection sensitivities, rx-override enabled\n- (RG_BBC1_OQPSKC2, 0x05), // FCS type legacy (16bit) & listen for LEG-OQPSK frames only\n- (RG_BBC1_OQPSKC3, 0x00), // legacy OQPSK, search for SFD_1 only\n- (RG_BBC0_IRQM, 0x00), // TXFE, RXFE, RXFS interrupts enabled\n- (RG_BBC1_IRQM, 0x13), // TXFE, RXFE, RXFS interrupts enabled\n- (RG_RF09_IRQM, 0x00), // TRXERR, TRXRDY interrupts enabled\n- (RG_RF24_IRQM, 0x12), // TRXERR, TRXRDY interrupts enabled\n- (RG_RF24_RXBWC, 0x0B), // Rx BW 2000kHz, IF 2000kHz\n- (RG_RF24_RXDFE, 0x41), //\n- (RG_RF24_AGCC, 0x01),\n- (RG_RF24_EDD, 0x13),\n- (RG_RF24_AGCS, 0x77),\n- (RG_RF24_TXCUTC, 0x0B), // .PARAMP = 3, .LPFCUT = 7\n- (RG_RF24_TXDFE, 0x81), // .SR = 0xA, .RCUT = 3\n- (RG_RF24_PAC, 0x7F)], // Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F. # 0x15~8dBm\n-}\n+ {RG_BBC1_PC, 0x1F},\n+ {RG_BBC1_OQPSKPHRTX, 0x09}, // QPSK - legacy\n+ {RG_BBC1_OQPSKC0, 0x03}, // 2000 kchips/s\n+ {RG_BBC1_OQPSKC1, 0x47}, // MINIMUM preamble-detection sensitivities, rx-override enabled\n+ {RG_BBC1_OQPSKC2, 0x05}, // FCS type legacy (16bit) & listen for LEG-OQPSK frames only\n+ {RG_BBC1_OQPSKC3, 0x00}, // legacy OQPSK, search for SFD_1 only\n+ {RG_BBC0_IRQM, 0x00}, // TXFE, RXFE, RXFS interrupts enabled\n+ {RG_BBC1_IRQM, 0x13}, // TXFE, RXFE, RXFS interrupts enabled\n+ {RG_RF09_IRQM, 0x00}, // TRXERR, TRXRDY interrupts enabled\n+ {RG_RF24_IRQM, 0x12}, // TRXERR, TRXRDY interrupts enabled\n+ {RG_RF24_RXBWC, 0x0B}, // Rx BW 2000kHz, IF 2000kHz\n+ {RG_RF24_RXDFE, 0x41}, //\n+ {RG_RF24_AGCC, 0x01},\n+ {RG_RF24_EDD, 0x13},\n+ {RG_RF24_AGCS, 0x77},\n+ {RG_RF24_TXCUTC, 0x0B}, // .PARAMP = 3, .LPFCUT = 7\n+ {RG_RF24_TXDFE, 0x81}, // .SR = 0xA, .RCUT = 3\n+ {RG_RF24_PAC, 0x7F}, // Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F. # 0x15~8dBm\n+};\n//------------------------------------ OFDM -----------------------------------//\n/** Preferred settings for OFDM */\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -121,7 +121,7 @@ void radio_init(void) {\nwhile(1); //UNKNOWN DEVICE, FINISH\n}\n// Write registers to radio -- configuration 2-FSK-50kbps\n- for( i = 0; i < (sizeof(basic_settings_ofdm_1_mcs2)/sizeof(registerSetting_t)); i++) {\n+ for( i = 0; i < (sizeof(basic_settings_fsk_option1)/sizeof(registerSetting_t)); i++) {\nat86rf215_spiWriteReg( basic_settings_fsk_option1[i].addr, basic_settings_fsk_option1[i].data);\n};\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -112,7 +112,7 @@ void cb_startFrame(PORT_TIMER_WIDTH timestamp);\nvoid cb_endFrame(PORT_TIMER_WIDTH timestamp);\n// uart\nvoid cb_uartTxDone(void);\n-void cb_uartRxCb(void);\n+uint8_t cb_uartRxCb(void);\n//=========================== main ============================================\n@@ -258,8 +258,9 @@ void cb_uartTxDone(void) {\n}\n}\n-void cb_uartRxCb(void) {\n+uint8_t cb_uartRxCb(void) {\n// uint8_t byte;\nuart_clearRxInterrupts();\n+ return 1;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"diff": "@@ -20,6 +20,10 @@ banner += [\"\"]\nbanner = '\\n'.join(banner)\nprint banner\n+XOFF = 0x13\n+XON = 0x11\n+XONXOFF_ESCAPE = 0x12\n+XONXOFF_MASK = 0x10\ndef mote_connect(motename=None , serialport= None, baudrate='115200'):\ntry:\n@@ -65,8 +69,10 @@ else:\n#============================ read ============================================\nrawFrame = []\n+rawFrame_decoded = []\npreviousFrame = 0\nframeCounter = 0\n+xonxoffEscaping = False\nwhile True:\n@@ -79,10 +85,18 @@ while True:\nif rawFrame[-3:]==[0xff]*3 and len(rawFrame)>=8:\n- frameCounter += 1\n+ for byte in rawFrame:\n+ if byte==XONXOFF_ESCAPE:\n+ xonxoffEscaping = True\n+ else:\n+ if xonxoffEscaping==True:\n+ rawFrame_decoded += [byte^XONXOFF_MASK]\n+ xonxoffEscaping=False\n+ elif byte!=XON and byte!=XOFF:\n+ rawFrame_decoded += [byte]\n(rxpk_len,rxpk_num,rxpk_rssi,rxpk_lqi,rxpk_crc) = \\\n- struct.unpack('>BBbBB', ''.join([chr(b) for b in rawFrame[-8:-3]]))\n+ struct.unpack('>BBbBB', ''.join([chr(b) for b in rawFrame_decoded[-8:-3]]))\nprint 'len={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4}'.format(\nrxpk_len,\nrxpk_num,\n@@ -93,12 +107,13 @@ while True:\nif previousFrame>rxpk_num:\nprint \"frameCounter={0:<3}\".format(frameCounter)\n- previousFrame = 0\nframeCounter = 0\n- else:\n+\n+ frameCounter += 1\npreviousFrame = rxpk_num\nif rxpk_len>127:\nprint \"ERROR: frame too long.\\a\"\nrawFrame = []\n+ rawFrame_decoded = []\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -24,7 +24,6 @@ remainder of the packet contains an incrementing bytes.\n#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes\n#define CHANNEL 16 // 24ghz: 11 = 2.405GHz, subghz: 0 = 863.125 in FSK operating mode #1\n#define TIMER_PERIOD (32768>>4) // (32768>>1) = 500ms @ 32kHz\n-#define SN_OVERFLOW 100 // sequence number resets to 0 when hit SN_OVERFLOW\n//=========================== variables =======================================\n@@ -101,11 +100,6 @@ int mote_main(void) {\nradio_loadPacket(app_vars.txpk_buf,app_vars.txpk_len);\nradio_txEnable();\nradio_txNow();\n-\n- // reset the sequence number\n- if (app_vars.txpk_num == SN_OVERFLOW){\n- app_vars.txpk_num = 0;\n- }\n}\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Update 01bsp_radio_rx and 01bsp_radio_tx projects.
|
491,595 |
28.11.2018 12:27:22
| -3,600 |
50154c09c82f12d2c9993d1c0703af86d83826b7
|
disable debug information printing.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"diff": "@@ -25,6 +25,8 @@ XON = 0x11\nXONXOFF_ESCAPE = 0x12\nXONXOFF_MASK = 0x10\n+MAX_NUM_PACKET = 256\n+\ndef mote_connect(motename=None , serialport= None, baudrate='115200'):\ntry:\nif (motename):\n@@ -94,19 +96,20 @@ while True:\nxonxoffEscaping=False\nelif byte!=XON and byte!=XOFF:\nrawFrame_decoded += [byte]\n-\n(rxpk_len,rxpk_num,rxpk_rssi,rxpk_lqi,rxpk_crc) = \\\nstruct.unpack('>BBbBB', ''.join([chr(b) for b in rawFrame_decoded[-8:-3]]))\n- print 'len={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4}'.format(\n- rxpk_len,\n- rxpk_num,\n- rxpk_rssi,\n- rxpk_lqi,\n- rxpk_crc\n- )\n+\n+ # debug info\n+ # print 'len={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4}'.format(\n+ # rxpk_len,\n+ # rxpk_num,\n+ # rxpk_rssi,\n+ # rxpk_lqi,\n+ # rxpk_crc\n+ # )\nif previousFrame>rxpk_num:\n- print \"frameCounter={0:<3}\".format(frameCounter)\n+ print \"frameCounter={0:<3}, PDR={1}%\".format(frameCounter, frameCounter*100/MAX_NUM_PACKET)\nframeCounter = 0\nframeCounter += 1\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
disable debug information printing.
|
491,595 |
28.11.2018 14:27:41
| -3,600 |
dcdfee792b25bd1900d7b751ae05425b9e27f9d3
|
support selection between 2.4ghz or subghz for atrf215 radio.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"new_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"diff": "#define NUMSENSORS 7\n+// frequency to use for atmel radio\n+\n+#define ATMEL_FREQUENCY_TYPE 0 // make sure cc2538 has the 2.4ghz antenna\n+\n//====== Antenna options ====\n#define BSP_ANTENNA_BASE GPIO_D_BASE\n#define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_4 //!< PD4 -- 2.4ghz\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/board.c",
"new_path": "bsp/boards/openmote-b-subghz/board.c",
"diff": "@@ -43,7 +43,10 @@ bool board_timer_expired(uint32_t future);\nstatic void clock_init(void);\nstatic void gpio_init(void);\nstatic void button_init(void);\n+\nstatic void antenna_init(void);\n+void antenna_cc2538(void);\n+void antenna_at86rf215(void);\nstatic void SysCtrlDeepSleepSetting(void);\nstatic void SysCtrlSleepSetting(void);\n@@ -83,9 +86,13 @@ void antenna_init(void) {\nGPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ);\nGPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ);\n- /* Use CC2538 antenna by default */\n- GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, 0);\n- GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, BSP_ANTENNA_AT215_24GHZ);\n+ if (ATMEL_FREQUENCY_TYPE == 0){\n+ // atmel is not using 2.4ghz, connect antenna to cc2538\n+ antenna_cc2538();\n+ } {\n+ // atmel is using 2.4ghz, connect antenna to atrf215\n+ antenna_at86rf215();\n+ }\n}\nvoid antenna_cc2538(void) {\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/board_info.h",
"new_path": "bsp/boards/openmote-b-subghz/board_info.h",
"diff": "#define NUMSENSORS 7\n+// frequency to use for atmel radio\n+\n+#define ATMEL_FREQUENCY_TYPE 0 // FEQ_SUGHZ = 0,\n+// #define FREQUENCY_TYPE FEQ_24GHZ // FEQ_24GHZ = 1,\n+\n//====== Antenna options ====\n#define BSP_ANTENNA_BASE GPIO_D_BASE\n#define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_4 //!< PD4 -- 2.4ghz\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.c",
"new_path": "bsp/chips/at86rf215/at86rf215.c",
"diff": "#include \"radio.h\"\n-void at86rf215_spiStrobe(uint8_t strobe) {\n+void at86rf215_spiStrobe(uint8_t strobe, uint8_t type) {\nuint8_t spi_tx_buffer[3];\n+ uint16_t register_cmd;\n+\n+ switch(type){\n+ case FREQ_SUGHZ:\n+ register_cmd = RG_RF09_CMD;\n+ break;\n+ case FREQ_24GHZ:\n+ register_cmd = RG_RF24_CMD;\n+ break;\n+ default:\n+ return;\n+ }\n+\n- spi_tx_buffer[0] = ((FLAG_WRITE) | (uint8_t)(RG_RF09_CMD/256));\n- spi_tx_buffer[1] = (uint8_t)(RG_RF09_CMD%256);\n+ spi_tx_buffer[0] = ((FLAG_WRITE) | (uint8_t)(register_cmd/256));\n+ spi_tx_buffer[1] = (uint8_t)(register_cmd%256);\nspi_tx_buffer[2] = strobe;\nspi_txrx(\n@@ -73,12 +86,27 @@ uint8_t at86rf215_spiReadReg(uint16_t regAddr16) {\nreturn spi_rx_buffer[2];\n}\n-void at86rf215_spiWriteFifo(uint8_t* bufToWrite, uint16_t len) {\n+void at86rf215_spiWriteFifo(uint8_t* bufToWrite, uint16_t len, uint8_t type) {\nuint8_t spi_tx_buffer[4];\n+ uint16_t register_bbc_txfll;\n+ uint16_t register_bbc_fbtxs;\n+\n+ switch(type){\n+ case FREQ_SUGHZ:\n+ register_bbc_txfll = RG_BBC0_TXFLL;\n+ register_bbc_fbtxs = RG_BBC0_FBTXS;\n+ break;\n+ case FREQ_24GHZ:\n+ register_bbc_txfll = RG_BBC1_TXFLL;\n+ register_bbc_fbtxs = RG_BBC1_FBTXS;\n+ break;\n+ default:\n+ return;\n+ }\n// step 1. send packet length.\n- spi_tx_buffer[0] = (FLAG_WRITE | (uint8_t)(RG_BBC0_TXFLL >> 8));\n- spi_tx_buffer[1] = (uint8_t)(RG_BBC0_TXFLL & 0xFF);\n+ spi_tx_buffer[0] = (FLAG_WRITE | (uint8_t)(register_bbc_txfll >> 8));\n+ spi_tx_buffer[1] = (uint8_t)(register_bbc_txfll & 0xFF);\nspi_tx_buffer[2] = (uint8_t)(len & 0xFF); // low byte of packet-length -> TXFLL\nspi_tx_buffer[3] = (uint8_t)(len >> 8) & 0x07; // high byte of packet-length -> TXFLH\n@@ -92,8 +120,8 @@ void at86rf215_spiWriteFifo(uint8_t* bufToWrite, uint16_t len) {\nSPI_LAST // isLast\n);\n- spi_tx_buffer[0] = (FLAG_WRITE | (uint8_t)(RG_BBC0_FBTXS >> 8));\n- spi_tx_buffer[1] = (uint8_t)(RG_BBC0_FBTXS& 0xFF);\n+ spi_tx_buffer[0] = (FLAG_WRITE | (uint8_t)(register_bbc_fbtxs >> 8));\n+ spi_tx_buffer[1] = (uint8_t)(register_bbc_fbtxs& 0xFF);\n// step 2. send the address to the Tx buffer.\nspi_txrx(\n@@ -119,15 +147,30 @@ void at86rf215_spiWriteFifo(uint8_t* bufToWrite, uint16_t len) {\n}\n-void at86rf215_spiReadRxFifo( uint8_t* pBufRead, uint16_t* lenRead) {\n+void at86rf215_spiReadRxFifo( uint8_t* pBufRead, uint16_t* lenRead, uint8_t type) {\nuint8_t spi_tx_buffer[4];\nuint8_t spi_rx_buffer[4];\nuint16_t length;\n+ uint16_t register_bbc_rxfll;\n+ uint16_t register_bbc_fbrxs;\n+\n+ switch(type){\n+ case FREQ_SUGHZ:\n+ register_bbc_rxfll = RG_BBC0_RXFLL;\n+ register_bbc_fbrxs = BASE_ADDR_BBC0_FB0;\n+ break;\n+ case FREQ_24GHZ:\n+ register_bbc_rxfll = RG_BBC1_RXFLL;\n+ register_bbc_fbrxs = BASE_ADDR_BBC1_FB1;\n+ break;\n+ default:\n+ return;\n+ }\n// step 1 - read packet length from RG_BBC0_RXFLL/_RXFLH:\n- spi_tx_buffer[0] = (FLAG_READ | (uint8_t)(RG_BBC0_RXFLL >> 8));\n- spi_tx_buffer[1] = (uint8_t)(RG_BBC0_RXFLL & 0xFF);\n+ spi_tx_buffer[0] = (FLAG_READ | (uint8_t)(register_bbc_rxfll >> 8));\n+ spi_tx_buffer[1] = (uint8_t)(register_bbc_rxfll & 0xFF);\nspi_tx_buffer[2] = 0x00;\nspi_tx_buffer[3] = 0x00;\n@@ -144,8 +187,8 @@ void at86rf215_spiReadRxFifo( uint8_t* pBufRead, uint16_t* lenRead) {\nlength = (uint16_t)spi_rx_buffer[2] // RXFLL\n| ((uint16_t)(spi_rx_buffer[3] & 0x07) << 8); // RXFLH\n- spi_tx_buffer[0] = (FLAG_READ | (uint8_t)(BASE_ADDR_BBC0_FB0/256));\n- spi_tx_buffer[1] = (uint8_t)(BASE_ADDR_BBC0_FB0%256);\n+ spi_tx_buffer[0] = (FLAG_READ | (uint8_t)(register_bbc_fbrxs/256));\n+ spi_tx_buffer[1] = (uint8_t)(register_bbc_fbrxs%256);\n//read FIFO\nspi_txrx(\nspi_tx_buffer, // bufTx\n@@ -169,12 +212,24 @@ void at86rf215_spiReadRxFifo( uint8_t* pBufRead, uint16_t* lenRead) {\n*(lenRead) = length;\n}\n-uint8_t at86rf215_status (void){\n+uint8_t at86rf215_status (uint8_t type){\nuint8_t spi_tx_buffer[3];\nuint8_t spi_rx_buffer[3];\n+ uint16_t register_state;\n+\n+ switch(type){\n+ case FREQ_SUGHZ:\n+ register_state = RG_RF09_STATE;\n+ break;\n+ case FREQ_24GHZ:\n+ register_state = RG_RF24_STATE;\n+ break;\n+ default:\n+ return 0;\n+ }\n- spi_tx_buffer[0] = (FLAG_READ | (uint8_t)(RG_RF09_STATE/256));\n- spi_tx_buffer[1] = (uint8_t)(RG_RF09_STATE%256);\n+ spi_tx_buffer[0] = (FLAG_READ | (uint8_t)(register_state/256));\n+ spi_tx_buffer[1] = (uint8_t)(register_state%256);\nspi_tx_buffer[2] = 0x00;\nspi_txrx(\n@@ -190,14 +245,26 @@ uint8_t at86rf215_status (void){\nreturn spi_rx_buffer[2];\n}\n-void at86rf215_read_isr (uint8_t* rf09_isr){\n+void at86rf215_read_isr (uint8_t* rf09_isr, uint8_t type){\nuint8_t spi_tx[6];\nuint8_t spi_rx[6];\n+ uint16_t register_irqs;\n+\n+ switch(type){\n+ case FREQ_SUGHZ:\n+ register_irqs = RG_RF09_IRQS;\n+ break;\n+ case FREQ_24GHZ:\n+ register_irqs = RG_RF24_IRQS;\n+ break;\n+ default:\n+ return;\n+ }\nmemset(&spi_tx[0],0,sizeof(spi_tx));\nmemset(&spi_rx[0],0,sizeof(spi_rx));\n- spi_tx[0] = (FLAG_READ | (uint8_t)(RG_RF09_IRQS >> 8));\n- spi_tx[1] = (uint8_t)(RG_RF09_IRQS & 0xFF);\n+ spi_tx[0] = (FLAG_READ | (uint8_t)(register_irqs >> 8));\n+ spi_tx[1] = (uint8_t)(register_irqs & 0xFF);\nspi_txrx(\nspi_tx, // bufTx\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.h",
"new_path": "bsp/chips/at86rf215/at86rf215.h",
"diff": "/* === EXTERNALS =========================================================== */\n/* === TYPES =============================================================== */\n+\n+enum\n+{\n+ FREQ_SUGHZ = 0,\n+ FREQ_24GHZ = 1,\n+};\n+\ntypedef struct\n{\nuint16_t addr;\n@@ -3968,14 +3975,17 @@ typedef enum bb_irq_tag\n} bb_irq_t;\n/* ========================== prototypes =================================== */\n-void at86rf215_spiStrobe (uint8_t strobe);\n+void at86rf215_spiStrobe (uint8_t strobe, uint8_t frequency_type);\n+\nvoid at86rf215_spiWriteReg (uint16_t reg, uint8_t regValueToWrite);\nuint8_t at86rf215_spiReadReg (uint16_t regAddr16);\n-void at86rf215_spiWriteFifo (uint8_t* bufToWrite, uint16_t len);\n-void at86rf215_spiReadRxFifo (uint8_t* pBufRead,\n- uint16_t* lenRead);\n-uint8_t at86rf215_status (void);\n-void at86rf215_read_isr (uint8_t* rf09_isr);\n+\n+void at86rf215_spiWriteFifo (uint8_t* bufToWrite, uint16_t len, uint8_t frequency_type);\n+void at86rf215_spiReadRxFifo (uint8_t* pBufRead, uint16_t* lenRead, uint8_t frequency_type);\n+\n+uint8_t at86rf215_status (uint8_t frequency_type);\n+\n+void at86rf215_read_isr (uint8_t* rf09_isr, uint8_t frequency_type);\nvoid at86rf215_readBurst(uint16_t reg, uint8_t* regValueRead, uint16_t size);\n//------------------------------------ FSK --------------------------------//\n@@ -4143,7 +4153,7 @@ static const registerSetting_t basic_settings_oqpsk_rate4[] = {\n{RG_RF09_PAC, 0x64},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F.\n};\n-static const registerSetting_t basic_settings_oqpsk_250kpbs[] = {\n+static const registerSetting_t basic_settings_oqpsk_250kbps[] = {\n{RG_BBC1_PC, 0x1F},\n{RG_BBC1_OQPSKPHRTX, 0x09}, // QPSK - legacy\n{RG_BBC1_OQPSKC0, 0x03}, // 2000 kchips/s\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "#define DEFAULT_CHANNEL_SPACING_FSK_OPTION_1 200 // kHz\n#define DEFAULT_CENTER_FREQUENCY_0_FSK_OPTION_1 863125 // Hz\n+\n+#define DEFAULT_CHANNEL_SPACING_OQPSK_24GHZ 5000 // kHz\n+#define DEFAULT_CENTER_FREQUENCY_0_OQPSK_24GHZ 850000 // Hz\n+\n//=========================== variables =======================================\ntypedef struct {\n@@ -95,8 +99,8 @@ void radio_init(void) {\n// reset radio\nradio_reset();\n- at86rf215_spiStrobe(CMD_RF_TRXOFF);\n- while(at86rf215_status() != RF_STATE_TRXOFF);\n+ at86rf215_spiStrobe(CMD_RF_TRXOFF, ATMEL_FREQUENCY_TYPE);\n+ while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TRXOFF);\n// change state\nradio_vars.state = RADIOSTATE_RFOFF;\n@@ -121,9 +125,16 @@ void radio_init(void) {\nwhile(1); //UNKNOWN DEVICE, FINISH\n}\n// Write registers to radio -- configuration 2-FSK-50kbps\n+ if (ATMEL_FREQUENCY_TYPE==FREQ_SUGHZ){\nfor( i = 0; i < (sizeof(basic_settings_fsk_option1)/sizeof(registerSetting_t)); i++) {\nat86rf215_spiWriteReg( basic_settings_fsk_option1[i].addr, basic_settings_fsk_option1[i].data);\n};\n+ } else {\n+ for( i = 0; i < (sizeof(basic_settings_oqpsk_250kbps)/sizeof(registerSetting_t)); i++) {\n+ at86rf215_spiWriteReg( basic_settings_oqpsk_250kbps[i].addr, basic_settings_oqpsk_250kbps[i].data);\n+ };\n+ }\n+\nradio_read_isr();\n}\n@@ -138,8 +149,8 @@ void radio_change_modulation(registerSetting_t * mod){\nstatic int mod_list = 1;\nuint16_t i;\n- at86rf215_spiStrobe(CMD_RF_TRXOFF);\n- while(at86rf215_status() != RF_STATE_TRXOFF);\n+ at86rf215_spiStrobe(CMD_RF_TRXOFF, ATMEL_FREQUENCY_TYPE);\n+ while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TRXOFF);\nfor( i = 0; i < (sizeof(*mod)/sizeof(registerSetting_t)); i++) {\nat86rf215_spiWriteReg( mod[i].addr, mod[i].data);\n@@ -161,11 +172,14 @@ void radio_setEndFrameCb(radio_capture_cbt cb) {\n//frequency_0 in kHz\n//frequency_nb integer\nvoid radio_setFrequency(uint16_t channel) {\n+\nuint16_t frequency_0;\n// frequency has to be updated in TRXOFF status (datatsheet: 6.3.2).\n- at86rf215_spiStrobe(CMD_RF_TRXOFF);\n- while(at86rf215_status() != RF_STATE_TRXOFF);\n+ at86rf215_spiStrobe(CMD_RF_TRXOFF, ATMEL_FREQUENCY_TYPE);\n+ while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TRXOFF);\n+\n+ if(ATMEL_FREQUENCY_TYPE==0){\nfrequency_0 = (DEFAULT_CENTER_FREQUENCY_0_FSK_OPTION_1/25);\nat86rf215_spiWriteReg(RG_RF09_CS, (uint8_t)(DEFAULT_CHANNEL_SPACING_FSK_OPTION_1/25));\n@@ -173,14 +187,23 @@ void radio_setFrequency(uint16_t channel) {\nat86rf215_spiWriteReg(RG_RF09_CCF0H, (uint8_t)(frequency_0/256));\nat86rf215_spiWriteReg(RG_RF09_CNL, (uint8_t)(channel%256));\nat86rf215_spiWriteReg(RG_RF09_CNM, (uint8_t)(channel/256));\n+ } else {\n+ frequency_0 = (DEFAULT_CENTER_FREQUENCY_0_OQPSK_24GHZ/25);\n+ at86rf215_spiWriteReg(RG_RF24_CS, (uint8_t)(DEFAULT_CHANNEL_SPACING_OQPSK_24GHZ/25));\n+ at86rf215_spiWriteReg(RG_RF24_CCF0L, (uint8_t)(frequency_0%256));\n+ at86rf215_spiWriteReg(RG_RF24_CCF0H, (uint8_t)(frequency_0/256));\n+ at86rf215_spiWriteReg(RG_RF24_CNL, (uint8_t)(channel%256));\n+ at86rf215_spiWriteReg(RG_RF24_CNM, (uint8_t)(channel/256));\n+ }\n+\n// change state\nradio_vars.state = RADIOSTATE_FREQUENCY_SET;\n}\nvoid radio_rfOn(void) {\n//put the radio in the TRXPREP state\n- at86rf215_spiStrobe(CMD_RF_TRXOFF);\n- while(at86rf215_status() != RF_STATE_TRXOFF);\n+ at86rf215_spiStrobe(CMD_RF_TRXOFF, ATMEL_FREQUENCY_TYPE);\n+ while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TRXOFF);\n}\nvoid radio_rfOff(void) {\n@@ -188,8 +211,8 @@ void radio_rfOff(void) {\n// change state\nradio_vars.state = RADIOSTATE_TURNING_OFF;\n- at86rf215_spiStrobe(CMD_RF_TRXOFF);\n- while(at86rf215_status() != RF_STATE_TRXOFF);\n+ at86rf215_spiStrobe(CMD_RF_TRXOFF, ATMEL_FREQUENCY_TYPE);\n+ while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TRXOFF);\n// wiggle debug pin\ndebugpins_radio_clr();\nleds_radio_off();\n@@ -203,7 +226,7 @@ void radio_rfOff(void) {\nvoid radio_loadPacket(uint8_t* packet, uint16_t len) {\nradio_vars.state = RADIOSTATE_LOADING_PACKET;\n- at86rf215_spiWriteFifo(packet, len);\n+ at86rf215_spiWriteFifo(packet, len, ATMEL_FREQUENCY_TYPE);\n// change state\nradio_vars.state = RADIOSTATE_PACKET_LOADED;\n//at86rf215_readBurst(0x0306, packet, len);\n@@ -218,8 +241,8 @@ void radio_txEnable(void) {\n// change state\nradio_vars.state = RADIOSTATE_ENABLING_TX;\n- at86rf215_spiStrobe(CMD_RF_TXPREP);\n- while(at86rf215_status() != RF_STATE_TXPREP);\n+ at86rf215_spiStrobe(CMD_RF_TXPREP, ATMEL_FREQUENCY_TYPE);\n+ while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TXPREP);\n// wiggle debug pin\ndebugpins_radio_set();\n@@ -235,7 +258,7 @@ void radio_txNow(void) {\n// change state\nradio_vars.state = RADIOSTATE_TRANSMITTING;\n- at86rf215_spiStrobe(CMD_RF_TX);\n+ at86rf215_spiStrobe(CMD_RF_TX, ATMEL_FREQUENCY_TYPE);\nif (radio_vars.startFrame_cb!=NULL) {\n// capture the time\n@@ -253,7 +276,7 @@ void radio_rxEnable(void) {\n// wiggle debug pin\ndebugpins_radio_set();\nleds_radio_on();\n- at86rf215_spiStrobe(CMD_RF_RX);\n+ at86rf215_spiStrobe(CMD_RF_RX, ATMEL_FREQUENCY_TYPE);\n// change state\nradio_vars.state = RADIOSTATE_LISTENING;\n@@ -261,7 +284,7 @@ void radio_rxEnable(void) {\nvoid radio_rxNow(void) {\n//nothing to do\n- if(at86rf215_status() != RF_STATE_RX){\n+ if(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_RX){\nleds_error_toggle();\nreturn;\n}\n@@ -277,7 +300,7 @@ void radio_getReceivedFrame(\nuint8_t* mcs\n) {\n// read the received packet from the RXFIFO\n- at86rf215_spiReadRxFifo(bufRead, lenRead);\n+ at86rf215_spiReadRxFifo(bufRead, lenRead, ATMEL_FREQUENCY_TYPE);\n*rssi = at86rf215_spiReadReg(RG_RF09_EDV);\n*crc = (at86rf215_spiReadReg(RG_BBC0_PC)>>5);\n*mcs = (at86rf215_spiReadReg(RG_BBC0_OFDMPHRRX)&OFDMPHRRX_MCS_MASK);\n@@ -287,7 +310,7 @@ void radio_getReceivedFrame(\nvoid radio_read_isr(void){\nuint8_t flags[4];\n- at86rf215_read_isr(flags);\n+ at86rf215_read_isr(flags, ATMEL_FREQUENCY_TYPE);\nradio_vars.rf09_isr = flags[0];\nradio_vars.rf24_isr = flags[1];\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
support selection between 2.4ghz or subghz for atrf215 radio.
|
491,595 |
28.11.2018 14:50:35
| -3,600 |
9a56f697f27b58bb260c84c468516117cb956f25
|
add scons option to select using 24ghz or not for atmel radio.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -42,6 +42,8 @@ if env['dagroot']==1:\nenv.Append(CPPDEFINES = 'DAGROOT')\nif env['forcetopology']==1:\nenv.Append(CPPDEFINES = 'FORCETOPOLOGY')\n+if env['use24ghz']==1:\n+ env.Append(CPPDEFINES = 'ATMEL_24GHZ')\nif env['noadaptivesync']==1:\nenv.Append(CPPDEFINES = 'NOADAPTIVESYNC')\nif env['l2_security']==1:\n"
},
{
"change_type": "MODIFY",
"old_path": "SConstruct",
"new_path": "SConstruct",
"diff": "@@ -144,6 +144,7 @@ command_line_options = {\n'dagroot': ['0','1'],\n'forcetopology': ['0','1'],\n'debug': ['0','1'],\n+ 'use24ghz': ['0','1'],\n'noadaptivesync': ['0','1'],\n'l2_security': ['0','1'],\n'msf_adapting_to_traffic': ['0','1'],\n@@ -281,6 +282,13 @@ command_line_vars.AddVariables(\nvalidate_option, # validator\nint, # converter\n),\n+ (\n+ 'use24ghz', # key\n+ '', # help\n+ command_line_options['use24ghz'][0], # default\n+ validate_option, # validator\n+ int, # converter\n+ ),\n(\n'noadaptivesync', # key\n'', # help\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"new_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"diff": "#define NUMSENSORS 7\n-// frequency to use for atmel radio\n-\n-#define ATMEL_FREQUENCY_TYPE 0 // make sure cc2538 has the 2.4ghz antenna\n-\n//====== Antenna options ====\n#define BSP_ANTENNA_BASE GPIO_D_BASE\n#define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_4 //!< PD4 -- 2.4ghz\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/board.c",
"new_path": "bsp/boards/openmote-b-subghz/board.c",
"diff": "@@ -86,13 +86,13 @@ void antenna_init(void) {\nGPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ);\nGPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ);\n- if (ATMEL_FREQUENCY_TYPE == 0){\n- // atmel is not using 2.4ghz, connect antenna to cc2538\n- antenna_cc2538();\n- } {\n+#ifdef ATMEL_24GHZ\n// atmel is using 2.4ghz, connect antenna to atrf215\nantenna_at86rf215();\n- }\n+#else\n+ // atmel is not using 2.4ghz, connect antenna to cc2538\n+ antenna_cc2538();\n+#endif\n}\nvoid antenna_cc2538(void) {\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/board_info.h",
"new_path": "bsp/boards/openmote-b-subghz/board_info.h",
"diff": "#define NUMSENSORS 7\n-// frequency to use for atmel radio\n-\n-#define ATMEL_FREQUENCY_TYPE 0 // FEQ_SUGHZ = 0,\n-// #define FREQUENCY_TYPE FEQ_24GHZ // FEQ_24GHZ = 1,\n-\n//====== Antenna options ====\n#define BSP_ANTENNA_BASE GPIO_D_BASE\n#define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_4 //!< PD4 -- 2.4ghz\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "#define DEFAULT_CHANNEL_SPACING_OQPSK_24GHZ 5000 // kHz\n#define DEFAULT_CENTER_FREQUENCY_0_OQPSK_24GHZ 850000 // Hz\n+#ifdef ATMEL_24GHZ\n+ #define ATMEL_FREQUENCY_TYPE FREQ_24GHZ\n+#else\n+ #define ATMEL_FREQUENCY_TYPE FREQ_SUGHZ\n+#endif\n+\n//=========================== variables =======================================\ntypedef struct {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
add scons option to select using 24ghz or not for atmel radio.
|
491,595 |
28.11.2018 16:05:36
| -3,600 |
fd09333bc8159b527c3414a2df8e39c7f0055d03
|
change name from use24ghz to atmel_24ghz
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -42,7 +42,7 @@ if env['dagroot']==1:\nenv.Append(CPPDEFINES = 'DAGROOT')\nif env['forcetopology']==1:\nenv.Append(CPPDEFINES = 'FORCETOPOLOGY')\n-if env['use24ghz']==1:\n+if env['atmel_24ghz']==1:\nenv.Append(CPPDEFINES = 'ATMEL_24GHZ')\nif env['noadaptivesync']==1:\nenv.Append(CPPDEFINES = 'NOADAPTIVESYNC')\n"
},
{
"change_type": "MODIFY",
"old_path": "SConstruct",
"new_path": "SConstruct",
"diff": "@@ -144,7 +144,7 @@ command_line_options = {\n'dagroot': ['0','1'],\n'forcetopology': ['0','1'],\n'debug': ['0','1'],\n- 'use24ghz': ['0','1'],\n+ 'atmel_24ghz': ['0','1'],\n'noadaptivesync': ['0','1'],\n'l2_security': ['0','1'],\n'msf_adapting_to_traffic': ['0','1'],\n@@ -283,9 +283,9 @@ command_line_vars.AddVariables(\nint, # converter\n),\n(\n- 'use24ghz', # key\n+ 'atmel_24ghz', # key\n'', # help\n- command_line_options['use24ghz'][0], # default\n+ command_line_options['atmel_24ghz'][0], # default\nvalidate_option, # validator\nint, # converter\n),\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
change name from use24ghz to atmel_24ghz
|
491,595 |
13.12.2018 09:52:17
| -3,600 |
d648d86fd66e48f1fbf937e803ddd6102b8d9731
|
Update Licencee
remove the copy right year.
|
[
{
"change_type": "MODIFY",
"old_path": "LICENSE.md",
"new_path": "LICENSE.md",
"diff": "-Copyright (c) 2010-2014, Regents of the University of California.\n+Copyright (c), Regents of the University of California.\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Update Licencee
remove the copy right year.
|
491,595 |
08.01.2019 16:11:04
| -3,600 |
ec79495cd8af968fc589e0891ac774a54d6b19f1
|
Fix 02drv_opentimer project.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/02drv_opentimers/02drv_opentimers.c",
"new_path": "projects/common/02drv_opentimers/02drv_opentimers.c",
"diff": "@@ -59,16 +59,16 @@ int mote_main(void) {\nscheduler_init();\nopentimers_init();\n- app_vars.timer0_id = opentimers_create(HIGHEST_PRIORITY);\n+ app_vars.timer0_id = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleAbsolute (\napp_vars.timer0_id, // id\nTIMER0_PERIOD_MS, // duration\n- opentimers_getCurrentTimeout(), // reference\n+ opentimers_getValue(), // reference\nTIME_MS, // time_type\ntimer0_cb // callback\n);\n- app_vars.timer1_id = opentimers_create(DEFAULT_PRIORITY);\n+ app_vars.timer1_id = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn (\napp_vars.timer1_id, // id\nTIMER1_PERIOD_MS, // duration\n@@ -77,7 +77,7 @@ int mote_main(void) {\ntimer1_cb // callback\n);\n- app_vars.timer2_id = opentimers_create(DEFAULT_PRIORITY);\n+ app_vars.timer2_id = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn (\napp_vars.timer2_id, // id\nTIMER2_PERIOD_MS, // duration\n@@ -98,7 +98,7 @@ void timer0_cb(opentimers_id_t id) {\nopentimers_scheduleAbsolute (\napp_vars.timer0_id, // id\nTIMER0_PERIOD_MS, // duration\n- opentimers_getCurrentTimeout(), // reference\n+ opentimers_getValue(), // reference\nTIME_MS, // time_type\ntimer0_cb // callback\n);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-24ghz/02drv_opentimers/02drv_opentimers.ewp",
"new_path": "projects/openmote-b-24ghz/02drv_opentimers/02drv_opentimers.ewp",
"diff": "<name>$PROJ_DIR$\\..\\..\\..\\inc\\opendefs.h</name>\n</file>\n</group>\n+ <group>\n+ <name>kernel</name>\n+ <group>\n+ <name>openos</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\kernel\\openos\\scheduler.c</name>\n+ </file>\n+ </group>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\kernel\\scheduler.h</name>\n+ </file>\n+ </group>\n<group>\n<name>projects</name>\n<group>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-24ghz/openmote_b-24ghz.eww",
"new_path": "projects/openmote-b-24ghz/openmote_b-24ghz.eww",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<workspace>\n+ <project>\n+ <path>$WS_DIR$\\01bsp_leds\\01bsp_leds.ewp</path>\n+ </project>\n<project>\n<path>$WS_DIR$\\01bsp_radio_rx\\01bsp_radio_rx.ewp</path>\n</project>\n<project>\n<path>$WS_DIR$\\01bsp_sctimer\\01bsp_sctimer.ewp</path>\n</project>\n+ <project>\n+ <path>$WS_DIR$\\02drv_openserial\\02drv_openserial.ewp</path>\n+ </project>\n<project>\n<path>$WS_DIR$\\02drv_opentimers\\02drv_opentimers.ewp</path>\n</project>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-790. Fix 02drv_opentimer project.
|
491,595 |
10.01.2019 11:54:33
| -3,600 |
1c75cd6bbbf92cfa8dd77f490b9a2cff70763cd7
|
quick fix: using 20ms for openmotestm.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmotestm/board_info.h",
"new_path": "bsp/boards/openmotestm/board_info.h",
"diff": "@@ -54,10 +54,10 @@ to return the board's description.\n//===== IEEE802154E timing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n// time-slot related\n-#define PORT_TsSlotDuration 491 // counter counts one extra count, see datasheet\n+#define PORT_TsSlotDuration 655 // counter counts one extra count, see datasheet\n// execution speed related\n#define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)\n#define PORT_maxRxAckPrepare 20 // 305us (measured 83us)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
quick fix: using 20ms for openmotestm.
|
491,595 |
10.01.2019 12:18:35
| -3,600 |
74f140a27fb4f3af4b6fd9f695d60ca82b8c5595
|
fix the warning when compiling bsp_uart project
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_uart/01bsp_uart.c",
"new_path": "projects/common/01bsp_uart/01bsp_uart.c",
"diff": "@@ -42,7 +42,7 @@ app_vars_t app_vars;\nvoid cb_compare(void);\nvoid cb_uartTxDone(void);\n-void cb_uartRxCb(void);\n+uint8_t cb_uartRxCb(void);\n//=========================== main ============================================\n@@ -101,7 +101,7 @@ void cb_uartTxDone(void) {\n}\n}\n-void cb_uartRxCb(void) {\n+uint8_t cb_uartRxCb(void) {\nuint8_t byte;\n// toggle LED\n@@ -112,4 +112,6 @@ void cb_uartRxCb(void) {\n// echo that byte over serial\nuart_writeByte(byte);\n+\n+ return 0;\n}\n\\ No newline at end of file\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-791. fix the warning when compiling bsp_uart project
|
491,595 |
10.01.2019 12:25:35
| -3,600 |
8b8ec313d55c9b043131a6c72fd462243e972281
|
fix 02drv_opentimers.ewp
|
[
{
"change_type": "MODIFY",
"old_path": "projects/iot-lab_M3/02drv_opentimers/02drv_opentimers.ewp",
"new_path": "projects/iot-lab_M3/02drv_opentimers/02drv_opentimers.ewp",
"diff": "<name>$PROJ_DIR$\\..\\..\\..\\inc\\opendefs.h</name>\n</file>\n</group>\n+ <group>\n+ <name>kernel</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\kernel\\openos\\scheduler.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\kernel\\scheduler.h</name>\n+ </file>\n+ </group>\n</project>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-791. fix 02drv_opentimers.ewp
|
491,595 |
10.01.2019 14:44:01
| -3,600 |
69b7440fcf28408870c5b5696e2aee2f44e469df
|
use channel 11 by default for bsp_radio_tx and bsp_radio_rx projects.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -73,7 +73,7 @@ len=17 num=84 rssi=-81 lqi=108 crc=1\n//=========================== defines =========================================\n#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes\n-#define CHANNEL 26 // 24ghz: 11 = 2.405GHz, subghz: 0 = 863.125 in FSK operating mode #1\n+#define CHANNEL 11 // 24ghz: 11 = 2.405GHz, subghz: 11 = 865.325 in FSK operating mode #1\n#define LENGTH_SERIAL_FRAME 8 // length of the serial frame\n//=========================== variables =======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -22,7 +22,7 @@ remainder of the packet contains an incrementing bytes.\n//=========================== defines =========================================\n#define LENGTH_PACKET 20+LENGTH_CRC // maximum length is 127 bytes\n-#define CHANNEL 26 // 24ghz: 11 = 2.405GHz, subghz: 0 = 863.125 in FSK operating mode #1\n+#define CHANNEL 11 // 24ghz: 11 = 2.405GHz, subghz: 11 = 865.325 in FSK operating mode #1\n#define TIMER_PERIOD (32768>>4) // (32768>>1) = 500ms @ 32kHz\n//=========================== variables =======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-792. use channel 11 by default for bsp_radio_tx and bsp_radio_rx projects.
|
491,595 |
10.01.2019 14:45:01
| -3,600 |
8ce456aa368ccfb385d177260f2f6c43af1e67b3
|
log received packet into files.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"diff": "@@ -100,17 +100,25 @@ while True:\nstruct.unpack('>BBbBB', ''.join([chr(b) for b in rawFrame_decoded[-8:-3]]))\n# debug info\n- # print 'len={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4}'.format(\n- # rxpk_len,\n- # rxpk_num,\n- # rxpk_rssi,\n- # rxpk_lqi,\n- # rxpk_crc\n- # )\n+ output = 'len={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4}'.format(\n+ rxpk_len,\n+ rxpk_num,\n+ rxpk_rssi,\n+ rxpk_lqi,\n+ rxpk_crc\n+ )\n+\n+ print output\n+\n+ with open('log.txt','a') as f:\n+ f.write(output+'\\n')\nif previousFrame>rxpk_num:\n- print \"frameCounter={0:<3}, PDR={1}%\".format(frameCounter, frameCounter*100/MAX_NUM_PACKET)\n+ output = \"frameCounter={0:<3}, PDR={1}%\".format(frameCounter, frameCounter*100/MAX_NUM_PACKET)\n+ print output\nframeCounter = 0\n+ with open('log.txt','a') as f:\n+ f.write(output+'\\n')\nframeCounter += 1\npreviousFrame = rxpk_num\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-792. log received packet into files.
|
491,595 |
04.02.2019 13:01:40
| -3,600 |
a71702b51d579a948b7ba7af3387c96b452f21a0
|
check isSync before re-transmitting join request.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -171,6 +171,10 @@ void cjoin_retransmission_cb(opentimers_id_t id) {\nvoid cjoin_retransmission_task_cb(void) {\nopen_addr_t* joinProxy;\n+ if (ieee154e_isSynch() == FALSE){\n+ return;\n+ }\n+\njoinProxy = neighbors_getJoinProxy();\nif(joinProxy == NULL) {\nopenserial_printError(\n@@ -189,7 +193,9 @@ void cjoin_task_cb(void) {\nopen_addr_t *joinProxy;\n// don't run if not synch\n- if (ieee154e_isSynch() == FALSE) return;\n+ if (ieee154e_isSynch() == FALSE){\n+ return;\n+ }\n// don't run if DAG root\nif (idmanager_getIsDAGroot() == TRUE) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-799. check isSync before re-transmitting join request.
|
491,595 |
05.02.2019 11:03:37
| -3,600 |
74ec1e8bef4a0edf163cd97ba434ea34127ebbd6
|
assign a task priority to each general purpose timer.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -99,8 +99,8 @@ void openserial_init(void) {\nopenserial_vars.outputBufIdxW = 0;\nopenserial_vars.fBusyFlushing = FALSE;\n- openserial_vars.reset_timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n- openserial_vars.debugPrint_timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ openserial_vars.reset_timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_OPENSERIAL);\n+ openserial_vars.debugPrint_timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_OPENSERIAL);\nopentimers_scheduleIn(\nopenserial_vars.debugPrint_timerId,\nDEBUGPRINT_PERIOD,\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -44,11 +44,12 @@ void opentimers_init(void){\n/**\n\\brief create a timer by assigning an entry from timer buffer.\n-create a timer with given id or assigning one if it's general purpose timer\n+create a timer with given id or assigning one if it's general purpose timer.\n+task_prio gives a priority when opentimer push a task.\n\\returns the id of the timer will be returned\n*/\n-opentimers_id_t opentimers_create(uint8_t timer_id){\n+opentimers_id_t opentimers_create(uint8_t timer_id, uint8_t task_prio){\nuint8_t id;\nINTERRUPT_DECLARATION();\n@@ -57,6 +58,8 @@ opentimers_id_t opentimers_create(uint8_t timer_id){\nif (timer_id==TIMER_TSCH || timer_id==TIMER_INHIBIT){\nif (opentimers_vars.timersBuf[timer_id].isUsed == FALSE){\nopentimers_vars.timersBuf[timer_id].isUsed = TRUE;\n+ // the TSCH timer and inhibit timer won't push a task,\n+ // hence task_prio is not used\nreturn timer_id;\n}\n}\n@@ -65,6 +68,7 @@ opentimers_id_t opentimers_create(uint8_t timer_id){\nfor (id=TIMER_NUMBER_NON_GENERAL;id<MAX_NUM_TIMERS;id++){\nif (opentimers_vars.timersBuf[id].isUsed == FALSE){\nopentimers_vars.timersBuf[id].isUsed = TRUE;\n+ opentimers_vars.timersBuf[id].timer_task_prio = task_prio;\nreturn id;\n}\n}\n@@ -388,7 +392,7 @@ void opentimers_timer_callback(void){\n} else {\nif (opentimers_vars.timersBuf[i].wraps_remaining==0){\nopentimers_vars.timersBuf[i].isrunning = FALSE;\n- scheduler_push_task((task_cbt)(opentimers_vars.timersBuf[i].callback),TASKPRIO_OPENTIMERS);\n+ scheduler_push_task((task_cbt)(opentimers_vars.timersBuf[i].callback),(task_prio_t)opentimers_vars.timersBuf[i].timer_task_prio);\nif (opentimers_vars.timersBuf[i].timerType==TIMER_PERIODIC){\nopentimers_vars.insideISR = TRUE;\nopentimers_scheduleIn(\n@@ -407,7 +411,7 @@ void opentimers_timer_callback(void){\nif (opentimers_vars.timersBuf[i].currentCompareValue - opentimers_vars.currentCompareValue < PRE_CALL_TIMER_WINDOW){\n// pre-call the timer here if it will be fired within PRE_CALL_TIMER_WINDOW, when wraps_remaining decrease to 0\nopentimers_vars.timersBuf[i].isrunning = FALSE;\n- scheduler_push_task((task_cbt)(opentimers_vars.timersBuf[i].callback),TASKPRIO_OPENTIMERS);\n+ scheduler_push_task((task_cbt)(opentimers_vars.timersBuf[i].callback),(task_prio_t)opentimers_vars.timersBuf[i].timer_task_prio);\nif (opentimers_vars.timersBuf[i].timerType==TIMER_PERIODIC){\nopentimers_vars.insideISR = TRUE;\nopentimers_scheduleIn(\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.h",
"new_path": "drivers/common/opentimers.h",
"diff": "@@ -58,6 +58,7 @@ typedef struct {\ntimer_type_t timerType; // the timer type\nbool hasExpired; // in case there are more than one interrupt occur at same time\nopentimers_cbt callback; // function to call when elapses\n+ uint8_t timer_task_prio; // when opentimer push a task, use timer_task_prio to mark the priority\n} opentimers_t;\n//=========================== module variables ================================\n@@ -73,7 +74,7 @@ typedef struct {\n//=========================== prototypes ======================================\nvoid opentimers_init(void);\n-opentimers_id_t opentimers_create(uint8_t priority);\n+opentimers_id_t opentimers_create(uint8_t timer_id, uint8_t task_priority);\nvoid opentimers_scheduleIn(opentimers_id_t id,\nuint32_t duration,\ntime_type_t uint_type,\n"
},
{
"change_type": "MODIFY",
"old_path": "kernel/scheduler.h",
"new_path": "kernel/scheduler.h",
"diff": "@@ -21,15 +21,16 @@ typedef enum {\nTASKPRIO_OPENTIMERS = 0x03,\nTASKPRIO_SIXTOP = 0x04,\nTASKPRIO_RPL = 0x05,\n- TASKPRIO_COAP = 0x06,\n- TASKPRIO_ADAPTIVE_SYNC = 0x07,\n- TASKPRIO_MSF = 0x08,\n+ TASKPRIO_UDP = 0x06,\n+ TASKPRIO_COAP = 0x07,\n+ TASKPRIO_ADAPTIVE_SYNC = 0x08,\n+ TASKPRIO_MSF = 0x09,\n// tasks trigger by other interrupts\n- TASKPRIO_BUTTON = 0x09,\n- TASKPRIO_SIXTOP_TIMEOUT = 0x0a,\n- TASKPRIO_SNIFFER = 0x0b,\n- TASKPRIO_OPENSERIAL = 0X0c,\n- TASKPRIO_MAX = 0x0d,\n+ TASKPRIO_BUTTON = 0x0a,\n+ TASKPRIO_SIXTOP_TIMEOUT = 0x0b,\n+ TASKPRIO_SNIFFER = 0x0c,\n+ TASKPRIO_OPENSERIAL = 0X0d,\n+ TASKPRIO_MAX = 0x0e,\n} task_prio_t;\n#define TASK_LIST_DEPTH 10\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cexample/cexample.c",
"new_path": "openapps/cexample/cexample.c",
"diff": "@@ -56,7 +56,7 @@ void cexample_init(void) {\nopencoap_register(&cexample_vars.desc);\n- cexample_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ cexample_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_COAP);\nopentimers_scheduleIn(\ncexample_vars.timerId,\nCEXAMPLEPERIOD,\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -74,7 +74,7 @@ void cjoin_init(void) {\nopencoap_register(&cjoin_vars.desc);\n- cjoin_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ cjoin_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_COAP);\nidmanager_setJoinKey((uint8_t *) masterSecret);\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/csensors/csensors.c",
"new_path": "openapps/csensors/csensors.c",
"diff": "@@ -408,7 +408,7 @@ void csensors_setPeriod(uint32_t period,\n);\n}\n} else {\n- csensors_vars.csensors_resource[id].timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ csensors_vars.csensors_resource[id].timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_COAP);\nopentimers_scheduleIn(\ncsensors_vars.csensors_resource[id].timerId,\n(uint32_t)((period*openrandom_get16b())/0xffff),\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cstorm/cstorm.c",
"new_path": "openapps/cstorm/cstorm.c",
"diff": "@@ -57,7 +57,7 @@ void cstorm_init(void) {\n//comment : not running by default\ncstorm_vars.period = 6553;\n- cstorm_vars.timerId = opentimers_create(DEFAULT_PRIORITY);\n+ cstorm_vars.timerId = opentimers_create(DEFAULT_PRIORITY, TASKPRIO_COAP);\nopentimers_scheduleIn(\ncstorm_vars.timerId,\ncstorm_vars.period,\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uexpiration/uexpiration.c",
"new_path": "openapps/uexpiration/uexpiration.c",
"diff": "@@ -70,7 +70,7 @@ void uexpiration_receive(OpenQueueEntry_t* request) {\nuexpiration_vars.period = pkt_interval;\n// start periodic timer\n- uexpiration_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ uexpiration_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_UDP);\nopentimers_scheduleIn(\nuexpiration_vars.timerId,\nuexpiration_vars.period,\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.c",
"new_path": "openapps/uinject/uinject.c",
"diff": "@@ -37,7 +37,7 @@ void uinject_init(void) {\nuinject_vars.period = UINJECT_PERIOD_MS;\n// start periodic timer\n- uinject_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ uinject_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_UDP);\nopentimers_scheduleIn(\nuinject_vars.timerId,\nUINJECT_PERIOD_MS,\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -150,7 +150,7 @@ void ieee154e_init(void) {\nradio_setStartFrameCb(ieee154e_startOfFrame);\nradio_setEndFrameCb(ieee154e_endOfFrame);\n// have the radio start its timer and assign ieee802154e timer with highest priority\n- ieee154e_vars.timerId = opentimers_create(TIMER_TSCH);\n+ ieee154e_vars.timerId = opentimers_create(TIMER_TSCH, TASKPRIO_NONE);\nopentimers_scheduleAbsolute(\nieee154e_vars.timerId, // timerId\nieee154e_vars.slotDuration, // duration\n@@ -160,7 +160,7 @@ void ieee154e_init(void) {\n);\n// radiotimer_start(ieee154e_vars.slotDuration);\nIEEE802154_security_init();\n- ieee154e_vars.serialInhibitTimerId = opentimers_create(TIMER_INHIBIT);\n+ ieee154e_vars.serialInhibitTimerId = opentimers_create(TIMER_INHIBIT, TASKPRIO_NONE);\n}\n//=========================== public ==========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -60,7 +60,7 @@ void msf_init(void) {\n&temp_neighbor // neighbor\n);\n- msf_vars.housekeepingTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ msf_vars.housekeepingTimerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_MSF);\nmsf_vars.housekeepingPeriod = HOUSEKEEPING_PERIOD;\nopentimers_scheduleIn(\nmsf_vars.housekeepingTimerId,\n@@ -69,7 +69,7 @@ void msf_init(void) {\nTIMER_PERIODIC,\nmsf_timer_housekeeping_cb\n);\n- msf_vars.waitretryTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ msf_vars.waitretryTimerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_MSF);\n}\n// called by schedule\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -108,7 +108,7 @@ void sixtop_init(void) {\nsixtop_vars.isResponseEnabled = TRUE;\nsixtop_vars.six2six_state = SIX_STATE_IDLE;\n- sixtop_vars.ebSendingTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ sixtop_vars.ebSendingTimerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_SIXTOP);\nopentimers_scheduleIn(\nsixtop_vars.ebSendingTimerId,\nSLOTFRAME_LENGTH*SLOTDURATION,\n@@ -117,7 +117,7 @@ void sixtop_init(void) {\nsixtop_sendingEb_timer_cb\n);\n- sixtop_vars.maintenanceTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ sixtop_vars.maintenanceTimerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_SIXTOP);\nopentimers_scheduleIn(\nsixtop_vars.maintenanceTimerId,\nsixtop_vars.periodMaintenance,\n@@ -126,7 +126,7 @@ void sixtop_init(void) {\nsixtop_maintenance_timer_cb\n);\n- sixtop_vars.timeoutTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ sixtop_vars.timeoutTimerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_SIXTOP);\n}\nvoid sixtop_setKaPeriod(uint16_t kaPeriod) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -85,7 +85,7 @@ void icmpv6rpl_init(void) {\nmemcpy(&icmpv6rpl_vars.dioDestination.addr_128b[0],all_routers_multicast,sizeof(all_routers_multicast));\nicmpv6rpl_vars.dioPeriod = DIO_PERIOD;\n- icmpv6rpl_vars.timerIdDIO = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ icmpv6rpl_vars.timerIdDIO = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_RPL);\n//initialize PIO -> move this to dagroot code\nicmpv6rpl_vars.pio.type = RPL_OPTION_PIO;\n@@ -170,7 +170,7 @@ void icmpv6rpl_init(void) {\nicmpv6rpl_vars.dao_target.prefixLength = 0;\nicmpv6rpl_vars.daoPeriod = DAO_PERIOD;\n- icmpv6rpl_vars.timerIdDAO = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ icmpv6rpl_vars.timerIdDAO = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_RPL);\nopentimers_scheduleIn(\nicmpv6rpl_vars.timerIdDAO,\nicmpv6rpl_vars.daoPeriod,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-800. assign a task priority to each general purpose timer.
|
491,595 |
05.02.2019 11:33:11
| -3,600 |
0a428adf9cdcf17bca842fbbcfbee8e00b1fb35a
|
fix project macpong and sniffer
|
[
{
"change_type": "MODIFY",
"old_path": "kernel/scheduler.h",
"new_path": "kernel/scheduler.h",
"diff": "@@ -20,17 +20,18 @@ typedef enum {\n// tasks triggered by timers\nTASKPRIO_OPENTIMERS = 0x03,\nTASKPRIO_SIXTOP = 0x04,\n- TASKPRIO_RPL = 0x05,\n- TASKPRIO_UDP = 0x06,\n- TASKPRIO_COAP = 0x07,\n- TASKPRIO_ADAPTIVE_SYNC = 0x08,\n- TASKPRIO_MSF = 0x09,\n+ TASKPRIO_IPHC = 0x05,\n+ TASKPRIO_RPL = 0x06,\n+ TASKPRIO_UDP = 0x07,\n+ TASKPRIO_COAP = 0x08,\n+ TASKPRIO_ADAPTIVE_SYNC = 0x09,\n+ TASKPRIO_MSF = 0x0a,\n// tasks trigger by other interrupts\n- TASKPRIO_BUTTON = 0x0a,\n- TASKPRIO_SIXTOP_TIMEOUT = 0x0b,\n- TASKPRIO_SNIFFER = 0x0c,\n- TASKPRIO_OPENSERIAL = 0X0d,\n- TASKPRIO_MAX = 0x0e,\n+ TASKPRIO_BUTTON = 0x0b,\n+ TASKPRIO_SIXTOP_TIMEOUT = 0x0c,\n+ TASKPRIO_SNIFFER = 0x0d,\n+ TASKPRIO_OPENSERIAL = 0X0e,\n+ TASKPRIO_MAX = 0x0f,\n} task_prio_t;\n#define TASK_LIST_DEPTH 10\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/03oos_macpong/03oos_macpong.c",
"new_path": "projects/common/03oos_macpong/03oos_macpong.c",
"diff": "@@ -109,7 +109,7 @@ void macpong_send(uint8_t payloadCtr) {\n//===== IPHC\nvoid iphc_init(void) {\n- macpong_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ macpong_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_IPHC);\nopentimers_scheduleIn(\nmacpong_vars.timerId, // timerId\n1000, // duration\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/03oos_sniffer/03oos_sniffer.c",
"new_path": "projects/common/03oos_sniffer/03oos_sniffer.c",
"diff": "@@ -83,7 +83,7 @@ int mote_main(void) {\nradio_setEndFrameCb(cb_endFrame);\n// start timer\n- app_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ app_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_SNIFFER);\nreference = opentimers_getValue();\nopentimers_scheduleAbsolute(\napp_vars.timerId, // timerId\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-24ghz/03oos_sniffer/03oos_sniffer.ewp",
"new_path": "projects/openmote-b-24ghz/03oos_sniffer/03oos_sniffer.ewp",
"diff": "</option>\n<option>\n<name>Input description</name>\n- <state>Automatic choice of formatter.</state>\n+ <state>Automatic choice of formatter, without multibyte support.</state>\n</option>\n<option>\n<name>Output description</name>\n- <state>Automatic choice of formatter.</state>\n+ <state>Automatic choice of formatter, without multibyte support.</state>\n</option>\n<option>\n<name>GOutputBinary</name>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\cstorm\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\rrt\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\openapps\\uinject\\</state>\n- <state>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\</state>\n- <state>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\</state>\n- <state>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\projects\\common\\03oos_openwsn</state>\n</option>\n<option>\n<group>\n<name>boards</name>\n<group>\n- <name>openmote-b-</name>\n+ <name>openmote-b-24ghz</name>\n<group>\n<name>headers</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_aes.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_aes.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_ana_regs.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_ana_regs.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_cctest.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_cctest.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_flash_ctrl.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_flash_ctrl.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_gpio.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_gpio.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_gptimer.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_gptimer.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_i2cm.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_i2cm.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_i2cs.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_i2cs.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_ints.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_ints.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_ioc.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_ioc.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_memmap.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_memmap.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_nvic.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_nvic.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_pka.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_pka.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_rfcore_ffsm.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_rfcore_ffsm.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_rfcore_sfr.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_rfcore_sfr.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_rfcore_xreg.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_rfcore_xreg.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_smwdthrosc.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_smwdthrosc.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_soc_adc.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_soc_adc.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_ssi.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_ssi.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_sys_ctrl.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_sys_ctrl.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_types.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_types.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_uart.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_uart.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_udma.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_udma.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_udmachctl.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_udmachctl.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\headers\\hw_usb.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\headers\\hw_usb.h</name>\n</file>\n</group>\n<group>\n<name>source</name>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\adc.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\adc.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\adc.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\adc.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\aes.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\aes.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\aes.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\aes.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\bl_commands.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\bl_commands.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\ccm.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\ccm.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\ccm.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\ccm.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\cpu.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\cpu.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\cpu.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\cpu.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\debug.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\debug.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\debug.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\debug.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\ecc_curveinfo.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\ecc_curveinfo.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\flash.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\flash.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\flash.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\flash.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\gpio.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\gpio.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\gpio.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\gpio.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\gptimer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\gptimer.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\gptimer.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\gptimer.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\i2c_lib.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\i2c_lib.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\i2c_lib.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\i2c_lib.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\interrupt.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\interrupt.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\interrupt.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\interrupt.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\ioc.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\ioc.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\ioc.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\ioc.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\pka.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\pka.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\pka.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\pka.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\rom.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\rom.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\sha256.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\sha256.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\sha256.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\sha256.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\sleepmode.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\sleepmode.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\sleepmode.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\sleepmode.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\ssi.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\ssi.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\ssi.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\ssi.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\sys_ctrl.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\sys_ctrl.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\sys_ctrl.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\sys_ctrl.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\systick.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\systick.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\systick.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\systick.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\uarthal.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\uarthal.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\uarthal.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\uarthal.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\udma.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\udma.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\udma.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\udma.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\watchdog.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\watchdog.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\source\\watchdog.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\source\\watchdog.h</name>\n</file>\n</group>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\adc_sensor.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\adc_sensor.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\adc_sensor.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\adc_sensor.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\board.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\board.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\board.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\board_info.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\board_info.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\cc2538rf.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\cc2538rf.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\cryptoengine.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\cryptoengine.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\debugpins.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\debugpins.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\eui64.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\debugpins.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\i2c.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\eui64.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\leds.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\eui64.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\radio.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\i2c.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\sctimer.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\i2c.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\startup_gcc.c</name>\n+ <excluded>\n+ <configuration>Debug</configuration>\n+ </excluded>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\leds.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\startup_iar.c</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\leds.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-24ghz\\uart.c</name>\n</file>\n+ </group>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\radio.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\board.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\radio.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\cryptoengine.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\sctimer.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\debugpins.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\sctimer.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\eui64.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\sensors.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\i2c.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\sensors.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\leds.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\spi.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\radio.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\startup_iar.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\sctimer.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\toolchain_defs.h</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\spi.h</name>\n</file>\n<file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-\\uart.c</name>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\toolchain_defs.h</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\uart.h</name>\n</file>\n</group>\n- </group>\n<group>\n<name>chips</name>\n<group>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-800. fix project macpong and sniffer
|
491,595 |
05.02.2019 16:10:00
| -3,600 |
7543315f6177e1aebc75988851e2c606ffd6cb83
|
rename function schedule_removeAllCellsToNeighbor to schedule_removeAllManagedUnicastCellsToNeighbor.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -462,7 +462,7 @@ bool schedule_isSlotOffsetAvailable(uint16_t slotOffset){\nreturn TRUE;\n}\n-void schedule_removeAllCellsToNeighbor(\n+void schedule_removeAllManagedUnicastCellsToNeighbor(\nuint8_t slotframeID,\nopen_addr_t* neighbor\n){\n@@ -470,7 +470,13 @@ void schedule_removeAllCellsToNeighbor(\n// remove all entries in schedule with previousHop address\nfor(i=0;i<MAXACTIVESLOTS;i++){\n- if (packetfunctions_sameAddress(&(schedule_vars.scheduleBuf[i].neighbor),neighbor)){\n+ if (\n+ packetfunctions_sameAddress(&(schedule_vars.scheduleBuf[i].neighbor),neighbor) &&\n+ (\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_TX ||\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_RX\n+ )\n+ ){\nschedule_removeActiveSlot(\nschedule_vars.scheduleBuf[i].slotOffset,\nneighbor\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -174,7 +174,7 @@ owerror_t schedule_removeActiveSlot(\n);\nvoid schedule_removeAllAutonomousTxRxCellUnicast(void);\nbool schedule_isSlotOffsetAvailable(uint16_t slotOffset);\n-void schedule_removeAllCellsToNeighbor(\n+void schedule_removeAllManagedUnicastCellsToNeighbor(\nuint8_t slotframeID,\nopen_addr_t* neighbor\n);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -883,7 +883,7 @@ void timer_sixtop_six2six_timeout_fired(void) {\nif (sixtop_vars.six2six_state == SIX_STATE_WAIT_CLEARRESPONSE){\n// no response for the 6p clear, just clear locally\n- schedule_removeAllCellsToNeighbor(\n+ schedule_removeAllManagedUnicastCellsToNeighbor(\nsixtop_vars.cb_sf_getMetadata(),\n&sixtop_vars.neighborToClearCells\n);\n@@ -980,7 +980,7 @@ void sixtop_six2six_sendDone(OpenQueueEntry_t* msg, owerror_t error){\n}\nif ( msg->l2_sixtop_command == IANA_6TOP_CMD_CLEAR){\n- schedule_removeAllCellsToNeighbor(\n+ schedule_removeAllManagedUnicastCellsToNeighbor(\nmsg->l2_sixtop_frameID,\n&(msg->l2_nextORpreviousHop)\n);\n@@ -1540,7 +1540,7 @@ void sixtop_six2six_notifyReceive(\n);\nbreak;\ncase SIX_STATE_WAIT_CLEARRESPONSE:\n- schedule_removeAllCellsToNeighbor(\n+ schedule_removeAllManagedUnicastCellsToNeighbor(\nsixtop_vars.cb_sf_getMetadata(),\n&(pkt->l2_nextORpreviousHop)\n);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-796. rename function schedule_removeAllCellsToNeighbor to schedule_removeAllManagedUnicastCellsToNeighbor.
|
491,595 |
05.02.2019 17:51:28
| -3,600 |
ce591f81378f58c467f1f6c3541dd21b61c34d65
|
fix drv_opentimers and mercator project.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/02drv_opentimers/02drv_opentimers.c",
"new_path": "projects/common/02drv_opentimers/02drv_opentimers.c",
"diff": "@@ -59,7 +59,7 @@ int mote_main(void) {\nscheduler_init();\nopentimers_init();\n- app_vars.timer0_id = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ app_vars.timer0_id = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_NONE);\nopentimers_scheduleAbsolute (\napp_vars.timer0_id, // id\nTIMER0_PERIOD_MS, // duration\n@@ -68,7 +68,7 @@ int mote_main(void) {\ntimer0_cb // callback\n);\n- app_vars.timer1_id = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ app_vars.timer1_id = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_NONE);\nopentimers_scheduleIn (\napp_vars.timer1_id, // id\nTIMER1_PERIOD_MS, // duration\n@@ -77,7 +77,7 @@ int mote_main(void) {\ntimer1_cb // callback\n);\n- app_vars.timer2_id = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ app_vars.timer2_id = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_NONE);\nopentimers_scheduleIn (\napp_vars.timer2_id, // id\nTIMER2_PERIOD_MS, // duration\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/03oos_mercator/03oos_mercator.c",
"new_path": "projects/common/03oos_mercator/03oos_mercator.c",
"diff": "@@ -18,7 +18,7 @@ int mote_main(void) {\nboard_init();\nscheduler_init();\nopentimers_init();\n- mercator_vars.sendTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ mercator_vars.sendTimerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_NONE);\nleds_all_off();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-800. fix drv_opentimers and mercator project.
|
491,595 |
06.02.2019 12:18:10
| -3,600 |
ebbc53daaaee4c1e5ac29027088a7cb3adeb8e5d
|
remove cells from 6p response side to CLEAR command.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -992,6 +992,15 @@ void sixtop_six2six_sendDone(OpenQueueEntry_t* msg, owerror_t error){\n}\n} else {\n// doesn't receive the ACK of response packet from request side after maximum retries.\n+\n+ // if the response is for CLEAR command, remove all the cells and reset seqnum regardless NO ack received.\n+ if ( msg->l2_sixtop_command == IANA_6TOP_CMD_CLEAR){\n+ schedule_removeAllManagedUnicastCellsToNeighbor(\n+ msg->l2_sixtop_frameID,\n+ &(msg->l2_nextORpreviousHop)\n+ );\n+ neighbors_resetSequenceNumber(&(msg->l2_nextORpreviousHop));\n+ }\n}\n}\n// free the buffer\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-801. remove cells from 6p response side to CLEAR command.
|
491,595 |
06.02.2019 12:27:10
| -3,600 |
ac9eb48505c36930e10ca09c59736743a3c39922
|
keep the retransmission timer in case the node gets synchronized next time.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -172,6 +172,13 @@ void cjoin_retransmission_task_cb(void) {\nopen_addr_t* joinProxy;\nif (ieee154e_isSynch() == FALSE){\n+ // keep the retransmission timer, in case it synchronized at next time\n+ opentimers_scheduleIn(cjoin_vars.timerId,\n+ (uint32_t) TIMEOUT,\n+ TIME_MS,\n+ TIMER_ONESHOT,\n+ cjoin_retransmission_cb\n+ );\nreturn;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-799. keep the retransmission timer in case the node gets synchronized next time.
|
491,595 |
06.02.2019 12:39:45
| -3,600 |
dd0e9e34d21da9904b55561875383805575f5686
|
give joinPriority default value of 0xff
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -760,6 +760,8 @@ void registerNewNeighbor(open_addr_t* address,\n//update jp\nif (joinPrioPresent==TRUE){\nneighbors_vars.neighbors[i].joinPrio=joinPrio;\n+ } else {\n+ neighbors_vars.neighbors[i].joinPrio=DEFAULTJOINPRIORITY;\n}\nbreak;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.h",
"new_path": "openstack/02b-MAChigh/neighbors.h",
"diff": "#define DEFAULTDAGRANK MAXDAGRANK\n#define MINHOPRANKINCREASE 256 //default value in RPL and Minimal 6TiSCH draft\n+#define DEFAULTJOINPRIORITY 0xff\n+\n//=========================== typedef =========================================\nBEGIN_PACK\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-802. give joinPriority default value of 0xff
|
491,595 |
06.02.2019 17:05:11
| -3,600 |
5c28871351adbc8c53855cca8481a1d15e5f1618
|
cancel join request retransmission timer only when the node joined.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -133,8 +133,6 @@ owerror_t cjoin_receive(OpenQueueEntry_t* msg,\ncojp_configuration_object_t configuration;\nowerror_t ret;\n- opentimers_cancel(cjoin_vars.timerId); // cancel the retransmission timer\n-\nif (coap_header->Code != COAP_CODE_RESP_CHANGED) {\nreturn E_FAIL;\n}\n@@ -149,12 +147,12 @@ owerror_t cjoin_receive(OpenQueueEntry_t* msg,\nIEEE802154_security_setDataKey(configuration.keyset.key[0].key_index, configuration.keyset.key[0].key_value);\nneighbor_removeAutonomousTxRxCellUnicast(&(msg->l2_nextORpreviousHop));\ncjoin_setIsJoined(TRUE); // declare join is over\n+ opentimers_cancel(cjoin_vars.timerId); // cancel the retransmission timer\nreturn E_SUCCESS;\n} else {\n// TODO not supported for now\n}\n-\nreturn E_FAIL;\n}\n@@ -184,6 +182,13 @@ void cjoin_retransmission_task_cb(void) {\njoinProxy = neighbors_getJoinProxy();\nif(joinProxy == NULL) {\n+ // keep the retransmission timer, in case it synchronized at next time\n+ opentimers_scheduleIn(cjoin_vars.timerId,\n+ (uint32_t) TIMEOUT,\n+ TIME_MS,\n+ TIMER_ONESHOT,\n+ cjoin_retransmission_cb\n+ );\nopenserial_printError(\nCOMPONENT_CJOIN,\nERR_ABORT_JOIN_PROCESS,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-803. cancel join request retransmission timer only when the node joined.
|
491,595 |
07.02.2019 13:03:39
| -3,600 |
0d1f99a6b58be79351bde1c9d9507d9b5b580d99
|
add a flag to indicate hash collision and use autonomous anycast cell to send 6p, join request and any downstream packet.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -981,10 +981,16 @@ port_INLINE void activity_ti1ORri1(void) {\n}\n} else {\n// this is autonomous TXRX cell (anycast)\n+ if (msf_getHashCollisionFlag()==TRUE){\n+ // check whether there is 6p or join request packet to send first\n+ ieee154e_vars.dataToSend = openqueue_macGet6PandJoinPacket(&neighbor);\n+ }\n+ if (ieee154e_vars.dataToSend == NULL) {\nieee154e_vars.dataToSend = openqueue_macGetDownStreamPacket(&neighbor);\n}\n}\n}\n+ }\nif (ieee154e_vars.dataToSend==NULL) {\nif (cellType==CELLTYPE_TX) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -417,3 +417,10 @@ uint8_t msf_hashFunction_getChanneloffset(uint16_t moteId){\nreturn moteId%NUM_CHANNELS;\n}\n+\n+void msf_setHashCollisionFlag(bool isCollision){\n+ msf_vars.f_hashCollision = isCollision;\n+}\n+bool msf_getHashCollisionFlag(void){\n+ return msf_vars.f_hashCollision;\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.h",
"new_path": "openstack/02b-MAChigh/msf.h",
"diff": "//=========================== typedef =========================================\ntypedef struct {\n+ bool f_hashCollision;\nuint8_t numAppPacketsPerSlotFrame;\nuint8_t backoff;\nuint8_t numCellsPassed;\n@@ -63,6 +64,9 @@ void msf_trigger6pClear(open_addr_t* neighbor);\nuint16_t msf_hashFunction_getSlotoffset(uint16_t moteId);\nuint8_t msf_hashFunction_getChanneloffset(uint16_t moteId);\n+\n+void msf_setHashCollisionFlag(bool isCollision);\n+bool msf_getHashCollisionFlag(void);\n/**\n\\}\n\\}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -120,6 +120,7 @@ open_addr_t* neighbors_getJoinProxy(void) {\nuint16_t moteId;\nuint16_t slotoffset;\nuint8_t channeloffset;\n+ uint16_t temp_slotoffset;\njoinPrioMinimum = 0xff;\njoinProxy = NULL;\n@@ -140,6 +141,12 @@ open_addr_t* neighbors_getJoinProxy(void) {\nmoteId = 256*joinProxy->addr_64b[6]+joinProxy->addr_64b[7];\nslotoffset = msf_hashFunction_getSlotoffset(moteId);\nchanneloffset = msf_hashFunction_getChanneloffset(moteId);\n+ if (\n+ schedule_getAutonomousTxRxCellAnycast(&temp_slotoffset) &&\n+ temp_slotoffset == slotoffset\n+ ){\n+ msf_setHashCollisionFlag(TRUE);\n+ } else {\n// reserve the autonomous cell to joinproxy\nschedule_addActiveSlot(\nslotoffset, // slot offset\n@@ -149,6 +156,7 @@ open_addr_t* neighbors_getJoinProxy(void) {\njoinProxy // neighbor\n);\n}\n+ }\nreturn joinProxy;\n}\n@@ -558,6 +566,7 @@ void neighbors_setPreferredParent(uint8_t index, bool isPreferred){\nuint16_t moteId;\nuint16_t slotoffset;\n+ uint16_t temp_slotoffset;\nuint8_t channeloffset;\nneighbors_vars.neighbors[index].parentPreference = isPreferred;\n@@ -569,6 +578,12 @@ void neighbors_setPreferredParent(uint8_t index, bool isPreferred){\nif (isPreferred){\n// the neighbor is selected as parent\n+ if (\n+ schedule_getAutonomousTxRxCellAnycast(&temp_slotoffset) &&\n+ temp_slotoffset == slotoffset\n+ ){\n+ msf_setHashCollisionFlag(TRUE);\n+ } else {\n// reserve the autonomous cell to this neighbor\nschedule_addActiveSlot(\nslotoffset, // slot offset\n@@ -577,10 +592,19 @@ void neighbors_setPreferredParent(uint8_t index, bool isPreferred){\nchanneloffset, // channel offset\n&(neighbors_vars.neighbors[index].addr_64b) // neighbor\n);\n+ }\n} else {\n// the neighbor is de-selected as parent\n+ if (\n+ schedule_getAutonomousTxRxCellAnycast(&temp_slotoffset) &&\n+ temp_slotoffset == slotoffset\n+ ){\n+ msf_setHashCollisionFlag(FALSE);\n+ } else {\n// remove the autonomous cell to this neighbor\n- if (schedule_hasAutonomousTxRxCellUnicast(&(neighbors_vars.neighbors[index].addr_64b))){\n+ if (\n+ schedule_hasAutonomousTxRxCellUnicast(&(neighbors_vars.neighbors[index].addr_64b))\n+ ){\nschedule_removeActiveSlot(\nslotoffset, // slot offset\n&(neighbors_vars.neighbors[index].addr_64b) // neighbor\n@@ -588,20 +612,29 @@ void neighbors_setPreferredParent(uint8_t index, bool isPreferred){\n}\n}\n}\n+}\nvoid neighbor_removeAutonomousTxRxCellUnicast(open_addr_t* address){\nuint16_t moteId;\nuint16_t slotoffset;\n+ uint16_t temp_slotoffset;\nmoteId = 256*address->addr_64b[6]+address->addr_64b[7];\nslotoffset = msf_hashFunction_getSlotoffset(moteId);\n+ if (\n+ schedule_getAutonomousTxRxCellAnycast(&temp_slotoffset) &&\n+ temp_slotoffset == slotoffset\n+ ){\n+ msf_setHashCollisionFlag(FALSE);\n+ } else {\nschedule_removeActiveSlot(\nslotoffset, // slotoffset\naddress // neighbor\n);\n}\n+}\nvoid neighbor_removeAllAutonomousTxRxCellUnicast(void){\n@@ -788,7 +821,9 @@ bool isNeighbor(open_addr_t* neighbor) {\nvoid removeNeighbor(uint8_t neighborIndex) {\n- uint16_t moteId, slotoffset;\n+ uint16_t moteId;\n+ uint16_t slotoffset;\n+ uint16_t temp_slotoffset;\nneighbors_vars.neighbors[neighborIndex].used = FALSE;\nneighbors_vars.neighbors[neighborIndex].parentPreference = 0;\n@@ -807,15 +842,24 @@ void removeNeighbor(uint8_t neighborIndex) {\nneighbors_vars.neighbors[neighborIndex].backoffExponenton = MINBE-1;;\nneighbors_vars.neighbors[neighborIndex].backoff = 0;\n- if (schedule_hasAutonomousTxRxCellUnicast(&(neighbors_vars.neighbors[neighborIndex].addr_64b))){\n+ if (\n+ schedule_hasAutonomousTxRxCellUnicast(&(neighbors_vars.neighbors[neighborIndex].addr_64b))\n+ ){\nmoteId = 256*neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[6]+\\\nneighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[7];\nslotoffset = msf_hashFunction_getSlotoffset(moteId);\n+ if (\n+ schedule_getAutonomousTxRxCellAnycast(&temp_slotoffset) &&\n+ slotoffset == temp_slotoffset\n+ ) {\n+ msf_setHashCollisionFlag(FALSE);\n+ } else {\nschedule_removeActiveSlot(\nslotoffset, // slot offset\n&(neighbors_vars.neighbors[neighborIndex].addr_64b) // neighbor\n);\n}\n+ }\nneighbors_vars.neighbors[neighborIndex].addr_64b.type = ADDR_NONE;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -501,6 +501,7 @@ void schedule_removeAllAutonomousTxRxCellUnicast(void){\n);\n}\n}\n+ msf_setHashCollisionFlag(FALSE);\n}\nuint8_t schedule_getNumberOfFreeEntries(){\n@@ -664,6 +665,28 @@ bool schedule_hasManagedTxCellToNeighbor(open_addr_t* neighbor){\nreturn FALSE;\n}\n+bool schedule_getAutonomousTxRxCellAnycast(uint16_t* slotoffset){\n+ uint8_t i;\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ for(i=0;i<MAXACTIVESLOTS;i++) {\n+ if(\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_TXRX &&\n+ schedule_vars.scheduleBuf[i].shared == FALSE &&\n+ schedule_vars.scheduleBuf[i].neighbor.type == ADDR_ANYCAST\n+ ){\n+ *slotoffset = schedule_vars.scheduleBuf[i].slotOffset;\n+ ENABLE_INTERRUPTS();\n+ return TRUE;\n+ }\n+ }\n+\n+ ENABLE_INTERRUPTS();\n+ return FALSE;\n+}\n+\n//=== from IEEE802154E: reading the schedule and updating statistics\nvoid schedule_syncSlotOffset(slotOffset_t targetSlotOffset) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -184,6 +184,7 @@ bool schedule_isNumTxWrapped(open_addr_t* neighbor);\nbool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist);\nbool schedule_hasAutonomousTxRxCellUnicast(open_addr_t* neighbor);\nbool schedule_hasManagedTxCellToNeighbor(open_addr_t* neighbor);\n+bool schedule_getAutonomousTxRxCellAnycast(uint16_t* slotoffset);\n// from IEEE802154E\nvoid schedule_syncSlotOffset(slotOffset_t targetSlotOffset);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -354,9 +354,11 @@ OpenQueueEntry_t* openqueue_macGet6PandJoinPacket(open_addr_t* toNeighbor){\nfor (i=0;i<QUEUELENGTH;i++) {\nif (\nopenqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n+ (\n(\ntoNeighbor->type==ADDR_64B &&\npacketfunctions_sameAddress(toNeighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop)\n+ ) || toNeighbor->type==ADDR_ANYCAST // in case autonomous unicast cells is located at the same slotoffset of autonomous anycast cell, send 6p and cjoin packets on anycast cell as well\n) &&\n(\nopenqueue_vars.queue[i].creator == COMPONENT_SIXTOP_RES ||\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-797. add a flag to indicate hash collision and use autonomous anycast cell to send 6p, join request and any downstream packet.
|
491,595 |
07.02.2019 13:09:47
| -3,600 |
69ae0f433834a14a9131a8bb0c82babe76627297
|
fix for simulation board.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -593,6 +593,8 @@ functionsToChange = [\n'neighbors_backoffHitZero',\n'neighbors_resetBackoff',\n'neighbors_removeOld',\n+ 'neighbor_removeAutonomousTxRxCellUnicast',\n+ 'neighbor_removeAllAutonomousTxRxCellUnicast',\n'debugPrint_neighbors',\n'registerNewNeighbor',\n'isNeighbor',\n@@ -631,12 +633,11 @@ functionsToChange = [\n'schedule_getNumberOfManagedTxCells',\n'schedule_hasAutonomousTxRxCellUnicast',\n'schedule_hasManagedTxCellToNeighbor',\n- 'neighbor_removeAutonomousTxRxCellUnicast',\n- 'neighbor_removeAllAutonomousTxRxCellUnicast',\n'schedule_isNumTxWrapped',\n'schedule_getCellsToBeRelocated',\n'schedule_getOneCellAfterOffset',\n'schedule_getToBeRemovedCells',\n+ 'schedule_getAutonomousTxRxCellAnycast',\n# msf\n'msf_init',\n'msf_appPktPeriod',\n@@ -658,6 +659,8 @@ functionsToChange = [\n'msf_updateCellsUsed',\n'msf_hashFunction_getSlotoffset',\n'msf_hashFunction_getChanneloffset',\n+ 'msf_setHashCollisionFlag',\n+ 'msf_getHashCollisionFlag',\n# sixtop\n'sixtop_init',\n'sixtop_setKaPeriod',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-797. fix for simulation board.
|
491,595 |
07.02.2019 15:13:09
| -3,600 |
ebebd77f03126ddbce93a294725981a14369be94
|
correct the errorDescription format.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "@@ -250,7 +250,7 @@ enum {\nERR_SIXTOP_COUNT = 0x3d, // there are {0} cells to request mote\nERR_SIXTOP_LIST = 0x3e, // the cells reserved to request mote contains slot {0} and slot {1}\nERR_SCHEDULE_ADDDUPLICATESLOT = 0x3f, // the slot {0} to be added is already in schedule\n- ERR_UNSUPPORTED_FORMAT = 0x40, // the received packet format is not supported {code location {0}}\n+ ERR_UNSUPPORTED_FORMAT = 0x40, // the received packet format is not supported (code location {0})\nERR_UNSUPPORTED_METADATA = 0x41, // the metadata type is not suppored\n//l3\nERR_6LORH_DEADLINE_EXPIRED = 0x42, // the received packet has expired\n@@ -258,10 +258,10 @@ enum {\n// join and OSCOAP\nERR_JOINED = 0x44, // node joined\nERR_SEQUENCE_NUMBER_OVERFLOW = 0x45, // OSCOAP sequence number reached maximum value\n- ERR_BUFFER_OVERFLOW = 0x46, // OSCOAP buffer overflow detected {code location {0}}\n+ ERR_BUFFER_OVERFLOW = 0x46, // OSCOAP buffer overflow detected (code location {0})\nERR_REPLAY_FAILED = 0x47, // OSCOAP replay protection failed\nERR_DECRYPTION_FAILED = 0x48, // OSCOAP decryption and tag verification failed\n- ERR_ABORT_JOIN_PROCESS = 0x49, // Aborted join process {code location {0}}\n+ ERR_ABORT_JOIN_PROCESS = 0x49, // Aborted join process (code location {0})\n};\n//=========================== typedef =========================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-804. correct the errorDescription format.
|
491,595 |
28.02.2019 16:18:35
| -3,600 |
4af6c52c92611473319e8035527157908725675a
|
wrong mote id to print.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -498,8 +498,8 @@ owerror_t forwarding_send_internal_RoutingTable(\nopenserial_printError(\nCOMPONENT_FORWARDING,\nERR_NO_NEXTHOP,\n- (errorparameter_t)msg->l3_destinationAdd.addr_128b[6],\n- (errorparameter_t)msg->l3_destinationAdd.addr_128b[7]\n+ (errorparameter_t)msg->l3_destinationAdd.addr_128b[14],\n+ (errorparameter_t)msg->l3_destinationAdd.addr_128b[15]\n);\nreturn E_FAIL;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-797. wrong mote id to print.
|
491,595 |
01.03.2019 11:39:30
| -3,600 |
46090892e6501fd2e69fbeb18254601055d2d82d
|
adapt the configuration value.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.h",
"new_path": "openstack/02b-MAChigh/msf.h",
"diff": "#define CELLOPTIONS_MSF CELLOPTIONS_TX\n#define NUMCELLS_MSF 1\n-#define MAX_NUMCELLS 16\n-#define LIM_NUMCELLSUSED_HIGH 12\n-#define LIM_NUMCELLSUSED_LOW 4\n+#define MAX_NUMCELLS 64\n+#define LIM_NUMCELLSUSED_HIGH 48\n+#define LIM_NUMCELLSUSED_LOW 16\n#define HOUSEKEEPING_PERIOD 30000 // miliseconds\n#define QUARANTINE_DURATION 300 // seconds\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -712,7 +712,7 @@ void neighbors_removeOld(void) {\nfor (i=0;i<MAXNUMNEIGHBORS;i++) {\nif (neighbors_vars.neighbors[i].used==1) {\ntimeSinceHeard = ieee154e_asnDiff(&neighbors_vars.neighbors[i].asn);\n- if (timeSinceHeard>DESYNCTIMEOUT) {\n+ if (timeSinceHeard>(2*DESYNCTIMEOUT)) {\nif (\nneighbors_vars.neighbors[i].f6PNORES == FALSE &&\nneighbors_vars.neighbors[i].inBlacklist == FALSE\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.h",
"new_path": "openstack/02b-MAChigh/neighbors.h",
"diff": "#define BADNEIGHBORMAXRSSI -70 //dBm\n#define GOODNEIGHBORMINRSSI -80 //dBm\n#define SWITCHSTABILITYTHRESHOLD 3\n-#define DEFAULTLINKCOST 8 // this value has too be no greater than 6, when MAXEB is 4 and MAXRETRIES is 4\n+#define DEFAULTLINKCOST 4\n#define MINIMAL_NUM_TX 16\n#define MAXDAGRANK 0xffff\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-797. adapt the configuration value.
|
491,595 |
01.03.2019 16:12:08
| -3,600 |
cf1d20db580b7b7ad65a345950c9ff15a538599e
|
use a fixed portion to send EB and DIO.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -562,7 +562,7 @@ port_INLINE void activity_synchronize_newSlot(void) {\n// update record of current channel\nieee154e_vars.freq = (openrandom_get16b()&0x0F) + 11;\n- // configure the radio to listen to the default synchronizing channel\n+ // configure the radio to listen to the frequency\nradio_setFrequency(ieee154e_vars.freq);\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n@@ -583,6 +583,17 @@ port_INLINE void activity_synchronize_newSlot(void) {\nsctimer_setCapture(ACTION_RX_DONE);\n#endif\n+ if (ieee154e_vars.asn.bytes0and1%(NUM_CHANNELS*EB_PORTION)==0) {\n+ // turn off the radio (in case it wasn't yet)\n+ radio_rfOff();\n+\n+ // update record of current channel\n+ ieee154e_vars.freq = (openrandom_get16b()&0x0F) + 11;\n+\n+ // configure the radio to listen to the frequency\n+ radio_setFrequency(ieee154e_vars.freq);\n+ }\n+\n// switch on the radio in Rx mode.\nradio_rxEnable();\nradio_rxNow();\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -42,6 +42,7 @@ static const uint8_t ebIEsBytestream[] = {\n#define TX_POWER 31 // 1=-25dBm, 31=0dBm (max value)\n#define RESYNCHRONIZATIONGUARD 5 // in 32kHz ticks. min distance to the end of the slot to successfully synchronize\n#define US_PER_TICK 30 // number of us per 32kHz clock tick\n+#define EB_PORTION 10 // set EB on minimal cell for 1/EB_PORTION portion\n#define MAXKAPERIOD 1000 // in slots: 1500@20ms per slot -> ~30 seconds. Max value used by adaptive synchronization.\n#define DESYNCTIMEOUT 1750 // in slots: 1750@20ms per slot -> ~35 seconds. A larger DESYNCTIMEOUT is needed if using a larger KATIMEOUT.\n#define LIMITLARGETIMECORRECTION 5 // threshold number of ticks to declare a timeCorrection \"large\"\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -646,9 +646,8 @@ void sixtop_timeout_timer_cb(opentimers_id_t id) {\n//======= EB/KA task\nvoid timer_sixtop_sendEb_fired(void) {\n- // send EBs on a portion of the minimal cells not exceeding 1/(3(N+1))\n- // https://tools.ietf.org/html/draft-chang-6tisch-msf-01#section-2\n- if(openrandom_get16b()<0xffff/(3*(neighbors_getNumNeighbors()+1))){\n+\n+ if(openrandom_get16b()<(0xffff/EB_PORTION)){\nsixtop_sendEB();\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "#include \"schedule.h\"\n#include \"msf.h\"\n+//=========================== definition ======================================\n+\n+#define DIO_PORTION 10\n+\n//=========================== variables =======================================\nicmpv6rpl_vars_t icmpv6rpl_vars;\n@@ -630,9 +634,8 @@ void icmpv6rpl_timer_DIO_cb(opentimers_id_t id) {\n\\note This function is executed in task context, called by the scheduler.\n*/\nvoid icmpv6rpl_timer_DIO_task(void) {\n- // send DIOs on a portion of the minimal cells not exceeding 1/(3(N+1))\n- // https://tools.ietf.org/html/draft-chang-6tisch-msf-01#section-2\n- if(openrandom_get16b()<0xffff/(3*(neighbors_getNumNeighbors()+1))){\n+\n+ if(openrandom_get16b()<(0xffff/DIO_PORTION)){\nsendDIO();\n}\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-810. use a fixed portion to send EB and DIO.
|
491,595 |
03.03.2019 11:04:14
| -3,600 |
469e928b902f4a6ab33b5c0ae95c30a01eae86d2
|
only remove the autonomous cell at first time the node joined. Let MSF install autonomous cell if the node has a parent.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -142,10 +142,14 @@ owerror_t cjoin_receive(OpenQueueEntry_t* msg,\nif (configuration.keyset.num_keys == 1 &&\nconfiguration.keyset.key[0].key_usage == COJP_KEY_USAGE_6TiSCH_K1K2_ENC_MIC32) {\n+ // only if I am not joined before, remove the previous installed autonomous cell\n+ if (cjoin_vars.isJoined==FALSE){\n+ neighbor_removeAutonomousTxRxCellUnicast(&(msg->l2_nextORpreviousHop));\n+ }\n+\n// set the L2 keys as per the parsed value\nIEEE802154_security_setBeaconKey(configuration.keyset.key[0].key_index, configuration.keyset.key[0].key_value);\nIEEE802154_security_setDataKey(configuration.keyset.key[0].key_index, configuration.keyset.key[0].key_value);\n- neighbor_removeAutonomousTxRxCellUnicast(&(msg->l2_nextORpreviousHop));\ncjoin_setIsJoined(TRUE); // declare join is over\nopentimers_cancel(cjoin_vars.timerId); // cancel the retransmission timer\nreturn E_SUCCESS;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -365,6 +365,11 @@ void msf_housekeeping(void){\ncellInfo_ht celllist_add[CELLLIST_MAX_LEN];\ncellInfo_ht celllist_delete[CELLLIST_MAX_LEN];\n+ uint16_t moteId;\n+ uint16_t slotoffset;\n+ uint16_t temp_slotoffset;\n+ uint8_t channeloffset;\n+\nif (ieee154e_isSynch()==FALSE) {\nreturn;\n}\n@@ -374,6 +379,30 @@ void msf_housekeeping(void){\nreturn;\n}\n+ if (schedule_hasAutonomousTxRxCellUnicast(&parentNeighbor)==FALSE){\n+\n+ moteId = 256*parentNeighbor.addr_64b[6]+parentNeighbor.addr_64b[7];\n+ slotoffset = msf_hashFunction_getSlotoffset(moteId);\n+ channeloffset = msf_hashFunction_getChanneloffset(moteId);\n+\n+ // the neighbor is selected as parent\n+ if (\n+ schedule_getAutonomousTxRxCellAnycast(&temp_slotoffset) &&\n+ temp_slotoffset == slotoffset\n+ ){\n+ msf_setHashCollisionFlag(TRUE);\n+ } else {\n+ // reserve the autonomous cell to this neighbor\n+ schedule_addActiveSlot(\n+ slotoffset, // slot offset\n+ CELLTYPE_TXRX, // type of slot\n+ TRUE, // shared?\n+ channeloffset, // channel offset\n+ &(parentNeighbor) // neighbor\n+ );\n+ }\n+ }\n+\nif (schedule_getNumberOfManagedTxCells(&parentNeighbor)==0){\nmsf_trigger6pAdd();\nreturn;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-811. only remove the autonomous cell at first time the node joined. Let MSF install autonomous cell if the node has a parent.
|
491,595 |
04.03.2019 11:16:34
| -3,600 |
75916d60380d07438c29a22600ddbab83cfa3b3e
|
don't push a task again in the timer callback function (except TSCH component) as they are scheduled as a task by opentimer already.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -859,7 +859,9 @@ void openserial_handleCommands(void){\n//===== misc\nvoid openserial_debugPrint_timer_cb(opentimers_id_t id){\n- scheduler_push_task(task_openserial_debugPrint,TASKPRIO_OPENSERIAL);\n+ // calling the task directly as the timer_cb function is executed in\n+ // task mode by opentimer already\n+ task_openserial_debugPrint();\n}\nvoid openserial_board_reset_cb(opentimers_id_t id) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cexample/cexample.c",
"new_path": "openapps/cexample/cexample.c",
"diff": "@@ -77,10 +77,10 @@ owerror_t cexample_receive( OpenQueueEntry_t* msg,\nreturn E_FAIL;\n}\n-//timer fired, but we don't want to execute task in ISR mode\n-//instead, push task to scheduler with COAP priority, and let scheduler take care of it\nvoid cexample_timer_cb(opentimers_id_t id){\n- scheduler_push_task(cexample_task_cb,TASKPRIO_COAP);\n+ // calling the task directly as the timer_cb function is executed in\n+ // task mode by opentimer already\n+ cexample_task_cb();\n}\nvoid cexample_task_cb(void) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -160,14 +160,16 @@ owerror_t cjoin_receive(OpenQueueEntry_t* msg,\nreturn E_FAIL;\n}\n-//timer fired, but we don't want to execute task in ISR mode\n-//instead, push task to scheduler with COAP priority, and let scheduler take care of it\nvoid cjoin_timer_cb(opentimers_id_t id){\n- scheduler_push_task(cjoin_task_cb,TASKPRIO_COAP);\n+ // calling the task directly as the timer_cb function is executed in\n+ // task mode by opentimer already\n+ cjoin_task_cb();\n}\nvoid cjoin_retransmission_cb(opentimers_id_t id) {\n- scheduler_push_task(cjoin_retransmission_task_cb, TASKPRIO_COAP);\n+ // calling the task directly as the timer_cb function is executed in\n+ // task mode by opentimer already\n+ cjoin_retransmission_task_cb();\n}\nvoid cjoin_retransmission_task_cb(void) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/csensors/csensors.c",
"new_path": "openapps/csensors/csensors.c",
"diff": "@@ -276,9 +276,10 @@ owerror_t csensors_receive(\n}\n/**\n- \\brief Called back from opentimers when a CoAP message is received for this resource.\n- Timer fired, but we don't want to execute task in ISR mode.\n- Instead, push task to scheduler with COAP priority, and let scheduler take care of it.\n+ \\brief Called back from opentimers when a CoAP message is received for\n+ this resource. This timer callback function scheduled as task already\n+ by OpenTimer component. No need to push another task.\n+\n\\param[in] id The opentimer identifier used to resolve the csensor resource associated\nparsed.\n*/\n@@ -299,7 +300,9 @@ void csensors_timer_cb(opentimers_id_t id){\nbreak;\n}\n}\n- scheduler_push_task(csensors_task_cb,TASKPRIO_COAP);\n+ // calling the task directly as the timer_cb function is executed in\n+ // task mode by opentimer already\n+ csensors_task_cb();\n}\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cstorm/cstorm.c",
"new_path": "openapps/cstorm/cstorm.c",
"diff": "@@ -147,12 +147,10 @@ owerror_t cstorm_receive(\nreturn outcome;\n}\n-/**\n-\\note timer fired, but we don't want to execute task in ISR mode instead, push\n- task to scheduler with CoAP priority, and let scheduler take care of it.\n-*/\nvoid cstorm_timer_cb(void) {\n- scheduler_push_task(cstorm_task_cb,TASKPRIO_COAP);\n+ // calling the task directly as the timer_cb function is executed in\n+ // task mode by opentimer already\n+ cstorm_task_cb();\n}\nvoid cstorm_task_cb(void) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uexpiration/uexpiration.c",
"new_path": "openapps/uexpiration/uexpiration.c",
"diff": "@@ -81,7 +81,9 @@ void uexpiration_receive(OpenQueueEntry_t* request) {\n}\nvoid uexpiration_timer_cb(opentimers_id_t id){\n- scheduler_push_task(uexpiration_task_cb,TASKPRIO_COAP);\n+ // calling the task directly as the timer_cb function is executed in\n+ // task mode by opentimer already\n+ uexpiration_task_cb();\n}\nvoid uexpiration_task_cb(void) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.c",
"new_path": "openapps/uinject/uinject.c",
"diff": "@@ -65,13 +65,10 @@ void uinject_receive(OpenQueueEntry_t* pkt) {\n//=========================== private =========================================\n-/**\n-\\note timer fired, but we don't want to execute task in ISR mode instead, push\n- task to scheduler with CoAP priority, and let scheduler take care of it.\n-*/\nvoid uinject_timer_cb(opentimers_id_t id){\n-\n- scheduler_push_task(uinject_task_cb,TASKPRIO_COAP);\n+ // calling the task directly as the timer_cb function is executed in\n+ // task mode by opentimer already\n+ uinject_task_cb();\n}\nvoid uinject_task_cb(void) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -180,10 +180,13 @@ void msf_timer_waitretry_cb(opentimers_id_t id){\nvoid msf_timer_housekeeping_cb(opentimers_id_t id){\nPORT_TIMER_WIDTH newDuration;\n- scheduler_push_task(msf_timer_housekeeping_task,TASKPRIO_MSF);\n-\n+ // update the timer period\nnewDuration = openrandom_getRandomizePeriod(msf_vars.housekeepingPeriod, msf_vars.housekeepingPeriod),\nopentimers_updateDuration(msf_vars.housekeepingTimerId, newDuration);\n+\n+ // calling the task directly as the timer_cb function is executed in\n+ // task mode by opentimer already\n+ msf_timer_housekeeping_task();\n}\n//=========================== tasks ============================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -630,17 +630,35 @@ owerror_t sixtop_send_internal(\nreturn E_SUCCESS;\n}\n-// timer interrupt callbacks\n+/**\n+\\brief sixtop sendingEb timer callback function.\n+\n+\\note This timer callback function is executed in task mode by opentimer\n+ already. No need to push a task again.\n+*/\nvoid sixtop_sendingEb_timer_cb(opentimers_id_t id){\n- scheduler_push_task(timer_sixtop_sendEb_fired,TASKPRIO_SIXTOP);\n+\n+ timer_sixtop_sendEb_fired();\n}\n+/**\n+\\brief sixtop maintenance timer callback function.\n+\n+\\note This timer callback function is executed in task mode by opentimer\n+ already. No need to push a task again.\n+*/\nvoid sixtop_maintenance_timer_cb(opentimers_id_t id) {\n- scheduler_push_task(timer_sixtop_management_fired,TASKPRIO_SIXTOP);\n+ timer_sixtop_management_fired();\n}\n+/**\n+\\brief sixtop timeout timer callback function.\n+\n+\\note This timer callback function is executed in task mode by opentimer\n+ already. No need to push a task again.\n+*/\nvoid sixtop_timeout_timer_cb(opentimers_id_t id) {\n- scheduler_push_task(timer_sixtop_six2six_timeout_fired,TASKPRIO_SIXTOP_TIMEOUT);\n+ timer_sixtop_six2six_timeout_fired();\n}\n//======= EB/KA task\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -621,11 +621,11 @@ void icmpv6rpl_killPreferredParent(void) {\n/**\n\\brief DIO timer callback function.\n-\\note This function is executed in interrupt context, and should only push a\n- task.\n+\\note This timer callback function is executed in task mode by opentimer\n+ already. No need to push a task again.\n*/\nvoid icmpv6rpl_timer_DIO_cb(opentimers_id_t id) {\n- scheduler_push_task(icmpv6rpl_timer_DIO_task,TASKPRIO_RPL);\n+ icmpv6rpl_timer_DIO_task();\n}\n/**\n@@ -787,11 +787,12 @@ void sendDIO(void) {\n/**\n\\brief DAO timer callback function.\n-\\note This function is executed in interrupt context, and should only push a\n- task.\n+\\note This timer callback function is executed in task mode by opentimer\n+ already. No need to push a task again.\n*/\nvoid icmpv6rpl_timer_DAO_cb(opentimers_id_t id) {\n- scheduler_push_task(icmpv6rpl_timer_DAO_task,TASKPRIO_RPL);\n+\n+ icmpv6rpl_timer_DAO_task();\n}\n/**\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-813. don't push a task again in the timer callback function (except TSCH component) as they are scheduled as a task by opentimer already.
|
491,595 |
06.03.2019 09:42:50
| -3,600 |
a234acaae44dd36ba9c80681ecbb896765e9f19a
|
add a traffic flow control for applications.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/cexample/cexample.c",
"new_path": "openapps/cexample/cexample.c",
"diff": "//#include \"ADC_Channel.h\"\n#include \"idmanager.h\"\n#include \"IEEE802154E.h\"\n+#include \"schedule.h\"\n+#include \"icmpv6rpl.h\"\n//=========================== defines =========================================\n@@ -89,6 +91,9 @@ void cexample_task_cb(void) {\nuint8_t i;\ncoap_option_iht options[2];\n+ open_addr_t parentNeighbor;\n+ bool foundNeighbor;\n+\nuint16_t x_int = 0;\nuint16_t sum = 0;\nuint16_t avg = 0;\n@@ -96,7 +101,9 @@ void cexample_task_cb(void) {\nuint8_t medtype;\n// don't run if not synch\n- if (ieee154e_isSynch() == FALSE) return;\n+ if (ieee154e_isSynch() == FALSE) {\n+ return;\n+ }\n// don't run on dagroot\nif (idmanager_getIsDAGroot()) {\n@@ -104,6 +111,20 @@ void cexample_task_cb(void) {\nreturn;\n}\n+ foundNeighbor = icmpv6rpl_getPreferredParentEui64(&parentNeighbor);\n+ if (foundNeighbor==FALSE) {\n+ return;\n+ }\n+\n+ if (schedule_hasManagedTxCellToNeighbor(&parentNeighbor) == FALSE) {\n+ return;\n+ }\n+\n+ if (cexample_vars.busySendingCexample==TRUE) {\n+ // don't continue if I'm still sending a previous cexample packet\n+ return;\n+ }\n+\nfor (i = 0; i < N_avg; i++) {\nsum += x_int;\n}\n@@ -146,6 +167,7 @@ void cexample_task_cb(void) {\n// metadata\npkt->l4_destination_port = WKP_UDP_COAP;\npkt->l3_destinationAdd.type = ADDR_128B;\n+ // does the ipAddr_motesEecs still work?\nmemcpy(&pkt->l3_destinationAdd.addr_128b[0],&ipAddr_motesEecs,16);\n// send\n@@ -162,13 +184,20 @@ void cexample_task_cb(void) {\n// avoid overflowing the queue if fails\nif (outcome==E_FAIL) {\nopenqueue_freePacketBuffer(pkt);\n+ } else {\n+ cexample_vars.busySendingCexample = TRUE;\n}\nreturn;\n}\nvoid cexample_sendDone(OpenQueueEntry_t* msg, owerror_t error) {\n+\n+ // free the packet buffer entry\nopenqueue_freePacketBuffer(msg);\n+\n+ // allow to send next cexample packet\n+ cexample_vars.busySendingCexample = FALSE;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cexample/cexample.h",
"new_path": "openapps/cexample/cexample.h",
"diff": "typedef struct {\ncoap_resource_desc_t desc;\nopentimers_id_t timerId;\n+ bool busySendingCexample;\n} cexample_vars_t;\n//=========================== variables =======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cstorm/cstorm.c",
"new_path": "openapps/cstorm/cstorm.c",
"diff": "#include \"scheduler.h\"\n//#include \"ADC_Channel.h\"\n#include \"IEEE802154E.h\"\n+#include \"schedule.h\"\n+#include \"icmpv6rpl.h\"\n#include \"idmanager.h\"\n//=========================== defines =========================================\n@@ -32,7 +34,7 @@ owerror_t cstorm_receive(\ncoap_option_iht* coap_outgoingOptions,\nuint8_t* coap_outgoingOptionsLen);\n-void cstorm_timer_cb(void);\n+void cstorm_timer_cb(opentimers_id_t id);\nvoid cstorm_task_cb(void);\nvoid cstorm_sendDone(OpenQueueEntry_t* msg, owerror_t error);\n@@ -52,12 +54,12 @@ void cstorm_init(void) {\ncstorm_vars.desc.callbackSendDone = &cstorm_sendDone;\nopencoap_register(&cstorm_vars.desc);\n- /*\n//start a periodic timer\n//comment : not running by default\n+ /*\ncstorm_vars.period = 6553;\n- cstorm_vars.timerId = opentimers_create(DEFAULT_PRIORITY, TASKPRIO_COAP);\n+ cstorm_vars.timerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_COAP);\nopentimers_scheduleIn(\ncstorm_vars.timerId,\ncstorm_vars.period,\n@@ -65,9 +67,6 @@ void cstorm_init(void) {\nTIMER_PERIODIC,\ncstorm_timer_cb\n);\n-\n- //stop\n- //opentimers_destroy(cstorm_vars.timerId);\n*/\n}\n@@ -147,7 +146,7 @@ owerror_t cstorm_receive(\nreturn outcome;\n}\n-void cstorm_timer_cb(void) {\n+void cstorm_timer_cb(opentimers_id_t id) {\n// calling the task directly as the timer_cb function is executed in\n// task mode by opentimer already\ncstorm_task_cb();\n@@ -159,8 +158,13 @@ void cstorm_task_cb(void) {\ncoap_option_iht options[2];\nuint8_t medType;\n+ open_addr_t parentNeighbor;\n+ bool foundNeighbor;\n+\n// don't run if not synch\n- if (ieee154e_isSynch() == FALSE) return;\n+ if (ieee154e_isSynch() == FALSE) {\n+ return;\n+ }\n// don't run on dagroot\nif (idmanager_getIsDAGroot()) {\n@@ -168,6 +172,20 @@ void cstorm_task_cb(void) {\nreturn;\n}\n+ foundNeighbor = icmpv6rpl_getPreferredParentEui64(&parentNeighbor);\n+ if (foundNeighbor==FALSE) {\n+ return;\n+ }\n+\n+ if (schedule_hasManagedTxCellToNeighbor(&parentNeighbor) == FALSE) {\n+ return;\n+ }\n+\n+ if (cstorm_vars.busySendingCstorm==TRUE) {\n+ // don't continue if I'm still sending a previous cstorm\n+ return;\n+ }\n+\nif(cstorm_vars.period == 0) {\n// stop the periodic timer\nopentimers_cancel(cstorm_vars.timerId);\n@@ -227,11 +245,17 @@ void cstorm_task_cb(void) {\n// avoid overflowing the queue if fails\nif (outcome==E_FAIL) {\nopenqueue_freePacketBuffer(pkt);\n+ } else {\n+ cstorm_vars.busySendingCstorm=FALSE;\n}\n}\nvoid cstorm_sendDone(OpenQueueEntry_t* msg, owerror_t error) {\n+ // free the packet buffer entry\nopenqueue_freePacketBuffer(msg);\n+\n+ // allow to send next cstorm packet\n+ cstorm_vars.busySendingCstorm=FALSE;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cstorm/cstorm.h",
"new_path": "openapps/cstorm/cstorm.h",
"diff": "@@ -20,6 +20,7 @@ typedef struct {\ncoap_resource_desc_t desc;\nopentimers_id_t timerId;\nuint16_t period; ///< inter-packet period (in ms)\n+ bool busySendingCstorm; ///< TRUE when busy sending cstorm packet\n} cstorm_vars_t;\n//=========================== prototypes ======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cwellknown/cwellknown.py",
"new_path": "openapps/cwellknown/cwellknown.py",
"diff": "@@ -2,7 +2,7 @@ import os\nimport sys\nhere = sys.path[0]\nprint here\n-sys.path.insert(0,os.path.join(here,'..','..','..','..','..','..','coap'))\n+sys.path.insert(0,os.path.join(here,'..','..','..','coap'))\nfrom coap import coap\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.c",
"new_path": "openapps/uinject/uinject.c",
"diff": "#include \"packetfunctions.h\"\n#include \"scheduler.h\"\n#include \"IEEE802154E.h\"\n+#include \"schedule.h\"\n+#include \"icmpv6rpl.h\"\n#include \"idmanager.h\"\n//=========================== variables =======================================\n@@ -48,7 +50,12 @@ void uinject_init(void) {\n}\nvoid uinject_sendDone(OpenQueueEntry_t* msg, owerror_t error) {\n+\n+ // free the packet buffer entry\nopenqueue_freePacketBuffer(msg);\n+\n+ // allow send next uinject packet\n+ uinject_vars.busySendingUinject = FALSE;\n}\nvoid uinject_receive(OpenQueueEntry_t* pkt) {\n@@ -74,9 +81,13 @@ void uinject_timer_cb(opentimers_id_t id){\nvoid uinject_task_cb(void) {\nOpenQueueEntry_t* pkt;\nuint8_t asnArray[5];\n+ open_addr_t parentNeighbor;\n+ bool foundNeighbor;\n// don't run if not synch\n- if (ieee154e_isSynch() == FALSE) return;\n+ if (ieee154e_isSynch() == FALSE) {\n+ return;\n+ }\n// don't run on dagroot\nif (idmanager_getIsDAGroot()) {\n@@ -84,6 +95,20 @@ void uinject_task_cb(void) {\nreturn;\n}\n+ foundNeighbor = icmpv6rpl_getPreferredParentEui64(&parentNeighbor);\n+ if (foundNeighbor==FALSE) {\n+ return;\n+ }\n+\n+ if (schedule_hasManagedTxCellToNeighbor(&parentNeighbor) == FALSE) {\n+ return;\n+ }\n+\n+ if (uinject_vars.busySendingUinject==TRUE) {\n+ // don't continue if I'm still sending a previous uinject packet\n+ return;\n+ }\n+\n// if you get here, send a packet\n// get a free packet buffer\n@@ -125,6 +150,9 @@ void uinject_task_cb(void) {\nif ((openudp_send(pkt))==E_FAIL) {\nopenqueue_freePacketBuffer(pkt);\n+ } else {\n+ // set busySending to TRUE\n+ uinject_vars.busySendingUinject = TRUE;\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.h",
"new_path": "openapps/uinject/uinject.h",
"diff": "//=========================== define ==========================================\n-#define UINJECT_PERIOD_MS 30000\n+#define UINJECT_PERIOD_MS 60000\n//=========================== typedef =========================================\n@@ -24,6 +24,7 @@ typedef struct {\nuint16_t counter; ///< incrementing counter which is written into the packet\nuint16_t period; ///< uinject packet sending period>\nudp_resource_desc_t desc; ///< resource descriptor for this module, used to register at UDP stack\n+ bool busySendingUinject; ///< TRUE when busy sending an uinject\n} uinject_vars_t;\n//=========================== prototypes ======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.py",
"new_path": "openapps/uinject/uinject.py",
"diff": "@@ -3,7 +3,7 @@ import struct\n# open socket\nsocket_handler = socket.socket(socket.AF_INET6,socket.SOCK_DGRAM)\n-socket_handler.bind(('',2000))\n+socket_handler.bind(('',61617))\nwhile True:\n@@ -16,5 +16,5 @@ while True:\nasn = struct.unpack('<HHB',request[-14:-9])\ncounter = struct.unpack('<h',request[-9:-7])\n- print 'received \"{0}\" from [{1}]:{2}'.format(counter,hisAddress,hisPort)\n+ print 'received \"{0}\" at asn {1} from [{2}]:{3}'.format(counter, asn, hisAddress,hisPort)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-813. add a traffic flow control for applications.
|
491,595 |
07.03.2019 09:45:47
| -3,600 |
8603cc25a450e7dfbf904a314b117f7a17171cba
|
don't free the buffer if notifying the packet received.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -2922,8 +2922,6 @@ void endSlot(void) {\n// would have been set to NULL in ri9.\n// indicate \"received packet\" to upper layer since we don't want to loose packets\nnotif_receive(ieee154e_vars.dataReceived);\n- // free dataReceived so corresponding RAM memory can be recycled\n- openqueue_freePacketBuffer(ieee154e_vars.dataReceived);\n// reset local variable\nieee154e_vars.dataReceived = NULL;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-813. don't free the buffer if notifying the packet received.
|
491,595 |
07.03.2019 18:42:46
| -3,600 |
5eed7fc878b6201d3ce0c8bcfb4458e796991c12
|
Get l2_nexthop from l3_src_address directly for join response packet, without checking it's in neighbor table or not.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -486,7 +486,7 @@ owerror_t forwarding_send_internal_RoutingTable(\nmsg->is_cjoin_response ||\nmsg->creator==COMPONENT_CJOIN\n){\n- if (neighbors_isStableNeighbor(&(msg->l3_destinationAdd))) {\n+ if (neighbors_isStableNeighbor(&(msg->l3_destinationAdd)) || msg->is_cjoin_response) {\n// IP destination is 1-hop neighbor, send directly\npacketfunctions_ip128bToMac64b(&(msg->l3_destinationAdd),&temp_prefix64btoWrite,&(msg->l2_nextORpreviousHop));\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-813. Get l2_nexthop from l3_src_address directly for join response packet, without checking it's in neighbor table or not.
|
491,595 |
08.03.2019 17:03:32
| -3,600 |
30e4b3c74038a41d8b4c19bb298a78db3e4c62f0
|
relocate the conflicted management cell before adding the autonomous cell.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/openapps.c",
"new_path": "openapps/openapps.c",
"diff": "@@ -43,7 +43,7 @@ void openapps_init(void) {\n// UDP\n//uecho_init();\n- //uinject_init();\n+ uinject_init();\n//userialbridge_init();\n//uexpiration_init();\n//umonitor_init();\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -854,6 +854,7 @@ port_INLINE bool ieee154e_processIEs(OpenQueueEntry_t* pkt, uint16_t* lenIE) {\nport_INLINE void activity_ti1ORri1(void) {\ncellType_t cellType;\nopen_addr_t neighbor;\n+ open_addr_t autonomousUnicastNeighbor;\nuint8_t i;\nuint8_t asn[5];\nuint8_t join_priority;\n@@ -996,8 +997,15 @@ port_INLINE void activity_ti1ORri1(void) {\n// check whether there is 6p or join request packet to send first\nieee154e_vars.dataToSend = openqueue_macGet6PandJoinPacket(&neighbor);\n}\n+\n+ if (ieee154e_vars.dataToSend == NULL) {\n+ if (schedule_getAutonomousTxRxCellUnicastNeighbor(&autonomousUnicastNeighbor)==TRUE){\n+ ieee154e_vars.dataToSend = openqueue_macGet6PRequestOnAnycast(&autonomousUnicastNeighbor);\n+ }\n+ }\n+\nif (ieee154e_vars.dataToSend == NULL) {\n- ieee154e_vars.dataToSend = openqueue_macGetDownStreamPacket(&neighbor);\n+ ieee154e_vars.dataToSend = openqueue_macGet6PResponseAndDownStreamPacket(&neighbor);\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -342,7 +342,7 @@ bool msf_candidateRemoveCellList(\nmemset(cellList,0,CELLLIST_MAX_LEN*sizeof(cellInfo_ht));\nnumCandCells = 0;\nfor(i=0;i<schedule_getFrameLength();i++){\n- schedule_getSlotInfo(i,neighbor,&info);\n+ schedule_getSlotInfo(i,&info);\nif(info.link_type == CELLTYPE_TX){\ncellList[numCandCells].slotoffset = i;\ncellList[numCandCells].channeloffset = info.channelOffset;\n@@ -364,6 +364,7 @@ bool msf_candidateRemoveCellList(\nvoid msf_housekeeping(void){\nopen_addr_t parentNeighbor;\n+ open_addr_t nonParentNeighbor;\nbool foundNeighbor;\ncellInfo_ht celllist_add[CELLLIST_MAX_LEN];\ncellInfo_ht celllist_delete[CELLLIST_MAX_LEN];\n@@ -373,6 +374,8 @@ void msf_housekeeping(void){\nuint16_t temp_slotoffset;\nuint8_t channeloffset;\n+ slotinfo_element_t info;\n+\nif (ieee154e_isSynch()==FALSE) {\nreturn;\n}\n@@ -382,6 +385,30 @@ void msf_housekeeping(void){\nreturn;\n}\n+ if (schedule_hasNonParentAutonomousTxRxCellUnicast(&parentNeighbor, &nonParentNeighbor)==TRUE){\n+\n+ if (schedule_hasManagedTxCellToNeighbor(&nonParentNeighbor)){\n+ // send a clear request to previous\n+\n+ sixtop_request(\n+ IANA_6TOP_CMD_CLEAR, // code\n+ &nonParentNeighbor, // neighbor\n+ NUMCELLS_MSF, // number cells\n+ CELLOPTIONS_MSF, // cellOptions\n+ NULL, // celllist to add (not used)\n+ NULL, // celllist to delete (not used)\n+ IANA_6TISCH_SFID_MSF, // sfid\n+ 0, // list command offset (not used)\n+ 0 // list command maximum celllist (not used)\n+ );\n+ return;\n+ } else {\n+ // remove the non-parent autonomous TxRxUnicast cell\n+\n+ neighbor_removeAutonomousTxRxCellUnicast(&nonParentNeighbor);\n+ }\n+ }\n+\nif (schedule_hasAutonomousTxRxCellUnicast(&parentNeighbor)==FALSE){\nmoteId = 256*parentNeighbor.addr_64b[6]+parentNeighbor.addr_64b[7];\n@@ -395,6 +422,7 @@ void msf_housekeeping(void){\n){\nmsf_setHashCollisionFlag(TRUE);\n} else {\n+ if (schedule_isSlotOffsetAvailable(slotoffset)){\n// reserve the autonomous cell to this neighbor\nschedule_addActiveSlot(\nslotoffset, // slot offset\n@@ -403,6 +431,36 @@ void msf_housekeeping(void){\nchanneloffset, // channel offset\n&(parentNeighbor) // neighbor\n);\n+ } else {\n+ // the autonomous cell has been occupied by other slot\n+ // trigger a 6P relocate packet to relocate that slot\n+\n+ // prepare the celllist to delete\n+ schedule_getSlotInfo(slotoffset, &info);\n+ memset(celllist_delete, 0, CELLLIST_MAX_LEN*sizeof(cellInfo_ht));\n+ celllist_delete[0].isUsed = TRUE;\n+ celllist_delete[0].slotoffset = slotoffset;\n+ celllist_delete[0].channeloffset = info.channelOffset;\n+\n+ // prepare the celllist to add\n+ if (msf_candidateAddCellList(celllist_add,NUMCELLS_MSF)==FALSE){\n+ // failed to get cell list to add\n+ return;\n+ }\n+\n+ sixtop_request(\n+ IANA_6TOP_CMD_RELOCATE, // code\n+ &(info.address), // neighbor\n+ NUMCELLS_MSF, // number cells\n+ info.link_type, // cellOptions\n+ celllist_add, // celllist to add\n+ celllist_delete, // celllist to delete\n+ IANA_6TISCH_SFID_MSF, // sfid\n+ 0, // list command offset (not used)\n+ 0 // list command maximum celllist (not used)\n+ );\n+ return;\n+ }\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -564,54 +564,7 @@ void neighbors_setNeighborNoResource(open_addr_t* address){\nvoid neighbors_setPreferredParent(uint8_t index, bool isPreferred){\n- uint16_t moteId;\n- uint16_t slotoffset;\n- uint16_t temp_slotoffset;\n- uint8_t channeloffset;\n-\nneighbors_vars.neighbors[index].parentPreference = isPreferred;\n-\n- moteId = 256*neighbors_vars.neighbors[index].addr_64b.addr_64b[6]+\\\n- neighbors_vars.neighbors[index].addr_64b.addr_64b[7];\n- slotoffset = msf_hashFunction_getSlotoffset(moteId);\n- channeloffset = msf_hashFunction_getChanneloffset(moteId);\n-\n- if (isPreferred){\n- // the neighbor is selected as parent\n- if (\n- schedule_getAutonomousTxRxCellAnycast(&temp_slotoffset) &&\n- temp_slotoffset == slotoffset\n- ){\n- msf_setHashCollisionFlag(TRUE);\n- } else {\n- // reserve the autonomous cell to this neighbor\n- schedule_addActiveSlot(\n- slotoffset, // slot offset\n- CELLTYPE_TXRX, // type of slot\n- TRUE, // shared?\n- channeloffset, // channel offset\n- &(neighbors_vars.neighbors[index].addr_64b) // neighbor\n- );\n- }\n- } else {\n- // the neighbor is de-selected as parent\n- if (\n- schedule_getAutonomousTxRxCellAnycast(&temp_slotoffset) &&\n- temp_slotoffset == slotoffset\n- ){\n- msf_setHashCollisionFlag(FALSE);\n- } else {\n- // remove the autonomous cell to this neighbor\n- if (\n- schedule_hasAutonomousTxRxCellUnicast(&(neighbors_vars.neighbors[index].addr_64b))\n- ){\n- schedule_removeActiveSlot(\n- slotoffset, // slot offset\n- &(neighbors_vars.neighbors[index].addr_64b) // neighbor\n- );\n- }\n- }\n- }\n}\nvoid neighbor_removeAutonomousTxRxCellUnicast(open_addr_t* address){\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -209,12 +209,10 @@ void schedule_setFrameNumber(uint8_t frameNumber) {\n\\brief Get the information of a specific slot.\n\\param slotOffset\n-\\param neighbor\n\\param info\n*/\nvoid schedule_getSlotInfo(\nslotOffset_t slotOffset,\n- open_addr_t* neighbor,\nslotinfo_element_t* info\n){\n@@ -224,11 +222,13 @@ void schedule_getSlotInfo(\nslotContainer = &schedule_vars.scheduleBuf[0];\nwhile (slotContainer<=&schedule_vars.scheduleBuf[schedule_vars.maxActiveSlots-1]) {\n//check that this entry for that neighbour and timeslot is not already scheduled.\n- if (packetfunctions_sameAddress(neighbor,&(slotContainer->neighbor)) && (slotContainer->slotOffset==slotOffset)){\n+ if (slotContainer->slotOffset==slotOffset){\n//it exists so this is an update.\ninfo->link_type = slotContainer->type;\ninfo->shared = slotContainer->shared;\n+ info->slotOffset = slotOffset;\ninfo->channelOffset = slotContainer->channelOffset;\n+ memcpy(&(info->address), &(slotContainer->neighbor), sizeof(open_addr_t));\nreturn; //as this is an update. No need to re-insert as it is in the same position on the list.\n}\nslotContainer++;\n@@ -237,6 +237,7 @@ void schedule_getSlotInfo(\ninfo->link_type = CELLTYPE_OFF;\ninfo->shared = FALSE;\ninfo->channelOffset = 0; //set to zero if not set.\n+ memset(&(info->address), 0, sizeof(open_addr_t));\n}\n/**\n@@ -643,6 +644,29 @@ bool schedule_hasAutonomousTxRxCellUnicast(open_addr_t* neighbor){\nreturn FALSE;\n}\n+bool schedule_getAutonomousTxRxCellUnicastNeighbor(open_addr_t* neighbor){\n+ uint8_t i;\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ for(i=0;i<MAXACTIVESLOTS;i++) {\n+ if(\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_TXRX &&\n+ schedule_vars.scheduleBuf[i].shared &&\n+ schedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\n+ packetfunctions_sameAddress(neighbor,&schedule_vars.scheduleBuf[i].neighbor)\n+ ){\n+ memcpy(neighbor, &schedule_vars.scheduleBuf[i].neighbor, sizeof(open_addr_t));\n+ ENABLE_INTERRUPTS();\n+ return TRUE;\n+ }\n+ }\n+\n+ ENABLE_INTERRUPTS();\n+ return FALSE;\n+}\n+\nbool schedule_hasManagedTxCellToNeighbor(open_addr_t* neighbor){\nuint8_t i;\n@@ -665,6 +689,29 @@ bool schedule_hasManagedTxCellToNeighbor(open_addr_t* neighbor){\nreturn FALSE;\n}\n+bool schedule_hasNonParentAutonomousTxRxCellUnicast(open_addr_t* parentNeighbor, open_addr_t* nonParentNeighbor){\n+ uint8_t i;\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ for(i=0;i<MAXACTIVESLOTS;i++) {\n+ if(\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_TXRX &&\n+ schedule_vars.scheduleBuf[i].shared &&\n+ schedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\n+ packetfunctions_sameAddress(parentNeighbor,&schedule_vars.scheduleBuf[i].neighbor) == FALSE\n+ ){\n+ memcpy(nonParentNeighbor,&schedule_vars.scheduleBuf[i].neighbor,sizeof(open_addr_t));\n+ ENABLE_INTERRUPTS();\n+ return TRUE;\n+ }\n+ }\n+\n+ ENABLE_INTERRUPTS();\n+ return FALSE;\n+}\n+\nbool schedule_getAutonomousTxRxCellAnycast(uint16_t* slotoffset){\nuint8_t i;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -122,7 +122,7 @@ typedef struct {\nEND_PACK\ntypedef struct {\n- uint8_t address[LENGTH_ADDR64b];\n+ open_addr_t address;\ncellType_t link_type;\nbool shared;\nslotOffset_t slotOffset;\n@@ -165,7 +165,6 @@ owerror_t schedule_addActiveSlot(\nvoid schedule_getSlotInfo(\nslotOffset_t slotOffset,\n- open_addr_t* neighbor,\nslotinfo_element_t* info\n);\nowerror_t schedule_removeActiveSlot(\n@@ -183,8 +182,11 @@ uint8_t schedule_getNumberOfManagedTxCells(open_addr_t* neighbor);\nbool schedule_isNumTxWrapped(open_addr_t* neighbor);\nbool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist);\nbool schedule_hasAutonomousTxRxCellUnicast(open_addr_t* neighbor);\n+bool schedule_getAutonomousTxRxCellUnicastNeighbor(open_addr_t* neighbor);\nbool schedule_hasManagedTxCellToNeighbor(open_addr_t* neighbor);\nbool schedule_getAutonomousTxRxCellAnycast(uint16_t* slotoffset);\n+bool schedule_hasNonParentManagedTxCell(open_addr_t* neighbor);\n+bool schedule_hasNonParentAutonomousTxRxCellUnicast(open_addr_t* neighbor, open_addr_t* nonParentNeighbor);\n// from IEEE802154E\nvoid schedule_syncSlotOffset(slotOffset_t targetSlotOffset);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -1749,9 +1749,9 @@ bool sixtop_areAvailableCellsToBeRemoved(\nif (cellList[i].isUsed){\nmemset(&info,0,sizeof(slotinfo_element_t));\nif (type==CELLTYPE_TXRX){\n- schedule_getSlotInfo(cellList[i].slotoffset,&anycastAddr,&info);\n+ schedule_getSlotInfo(cellList[i].slotoffset,&info);\n} else {\n- schedule_getSlotInfo(cellList[i].slotoffset,neighbor,&info);\n+ schedule_getSlotInfo(cellList[i].slotoffset,&info);\n}\nif(info.link_type != type){\navailable = FALSE;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -183,7 +183,7 @@ OpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void) {\n//======= called by IEEE80215E\n-OpenQueueEntry_t* openqueue_macGetDownStreamPacket(open_addr_t* toNeighbor) {\n+OpenQueueEntry_t* openqueue_macGet6PResponseAndDownStreamPacket(open_addr_t* toNeighbor) {\nuint8_t i;\nINTERRUPT_DECLARATION();\nDISABLE_INTERRUPTS();\n@@ -206,32 +206,46 @@ OpenQueueEntry_t* openqueue_macGetDownStreamPacket(open_addr_t* toNeighbor) {\n}\n}\n- if (toNeighbor->type==ADDR_64B) {\n- // a neighbor is specified, look for a packet unicast to that neigbhbor\n+ // look for a packet which is either from openbridge or forwarding component by source routing\nfor (i=0;i<QUEUELENGTH;i++) {\n- if (openqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n- packetfunctions_sameAddress(toNeighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop)\n+ if (\n+ openqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n+ (\n+ openqueue_vars.queue[i].creator==COMPONENT_OPENBRIDGE ||\n+ openqueue_vars.queue[i].l3_useSourceRouting == TRUE ||\n+ openqueue_vars.queue[i].is_cjoin_response\n+ )\n) {\nENABLE_INTERRUPTS();\nreturn &openqueue_vars.queue[i];\n}\n}\n- } else if (toNeighbor->type==ADDR_ANYCAST) {\n- // anycast case: look for a packet which is either from openbridge or forwarding component by source routing\n+ ENABLE_INTERRUPTS();\n+ return NULL;\n+}\n+\n+OpenQueueEntry_t* openqueue_macGet6PRequestOnAnycast(open_addr_t* autonomousUnicastNeighbor){\n+ uint8_t i;\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\nfor (i=0;i<QUEUELENGTH;i++) {\nif (\nopenqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n+ openqueue_vars.queue[i].creator==COMPONENT_SIXTOP_RES &&\n(\n- openqueue_vars.queue[i].creator==COMPONENT_OPENBRIDGE ||\n- openqueue_vars.queue[i].l3_useSourceRouting == TRUE ||\n- openqueue_vars.queue[i].is_cjoin_response\n+ (\n+ autonomousUnicastNeighbor->type==ADDR_64B &&\n+ packetfunctions_sameAddress(autonomousUnicastNeighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop) == FALSE\n)\n+ ) &&\n+ openqueue_vars.queue[i].l2_sixtop_messageType == SIXTOP_CELL_REQUEST\n){\nENABLE_INTERRUPTS();\nreturn &openqueue_vars.queue[i];\n}\n}\n- }\n+\nENABLE_INTERRUPTS();\nreturn NULL;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.h",
"new_path": "openstack/cross-layers/openqueue.h",
"diff": "@@ -42,7 +42,8 @@ bool openqueue_isHighPriorityEntryEnough(void);\nOpenQueueEntry_t* openqueue_sixtopGetSentPacket(void);\nOpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void);\n// called by IEEE80215E\n-OpenQueueEntry_t* openqueue_macGetDownStreamPacket(open_addr_t* toNeighbor);\n+OpenQueueEntry_t* openqueue_macGet6PResponseAndDownStreamPacket(open_addr_t* toNeighbor);\n+OpenQueueEntry_t* openqueue_macGet6PRequestOnAnycast(open_addr_t* autonomousUnicastNeighbor);\nOpenQueueEntry_t* openqueue_macGetEBPacket(void);\nOpenQueueEntry_t* openqueue_macGetKaPacket(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGetDIOPacket(void);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -632,12 +632,15 @@ functionsToChange = [\n'schedule_getNumberOfFreeEntries',\n'schedule_getNumberOfManagedTxCells',\n'schedule_hasAutonomousTxRxCellUnicast',\n+ 'schedule_getAutonomousTxRxCellUnicastNeighbor',\n'schedule_hasManagedTxCellToNeighbor',\n'schedule_isNumTxWrapped',\n'schedule_getCellsToBeRelocated',\n'schedule_getOneCellAfterOffset',\n'schedule_getToBeRemovedCells',\n'schedule_getAutonomousTxRxCellAnycast',\n+ 'schedule_hasNonParentManagedTxCell',\n+ 'schedule_hasNonParentAutonomousTxRxCellUnicast',\n# msf\n'msf_init',\n'msf_appPktPeriod',\n@@ -820,7 +823,8 @@ functionsToChange = [\n'openqueue_isHighPriorityEntryEnough',\n'openqueue_sixtopGetSentPacket',\n'openqueue_sixtopGetReceivedPacket',\n- 'openqueue_macGetDownStreamPacket',\n+ 'openqueue_macGet6PResponseAndDownStreamPacket',\n+ 'openqueue_macGet6PRequestOnAnycast',\n'openqueue_macGetEBPacket',\n'openqueue_macGetKaPacket',\n'openqueue_reset_entry',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-815. relocate the conflicted management cell before adding the autonomous cell.
|
491,595 |
08.03.2019 19:56:06
| -3,600 |
a90576a4e3053d8736e05333481f811cf5544ba2
|
change the nexthop payload for upstream IPv6 packets.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "@@ -203,65 +203,66 @@ enum {\nERR_HOP_LIMIT_REACHED = 0x11, // packet discarded hop limit reached\nERR_LOOP_DETECTED = 0x12, // loop detected due to previous rank {0} lower than current node rank {1}\nERR_WRONG_DIRECTION = 0x13, // upstream packet set to be downstream, possible loop.\n+ ERR_FORWARDING_PACKET_DROPPED = 0x14, // the forwarding packet received from mote {0:x}{1:x} is dropped because of queue buffer is full\n// l2b\n- ERR_NEIGHBORS_FULL = 0x14, // neighbors table is full (max number of neighbor is {0})\n- ERR_NO_SENT_PACKET = 0x15, // there is no sent packet in queue\n- ERR_NO_RECEIVED_PACKET = 0x16, // there is no received packet in queue\n- ERR_SCHEDULE_OVERFLOWN = 0x17, // schedule overflown\n+ ERR_NEIGHBORS_FULL = 0x15, // neighbors table is full (max number of neighbor is {0})\n+ ERR_NO_SENT_PACKET = 0x16, // there is no sent packet in queue\n+ ERR_NO_RECEIVED_PACKET = 0x17, // there is no received packet in queue\n+ ERR_SCHEDULE_OVERFLOWN = 0x18, // schedule overflown\n// l2a\n- ERR_WRONG_CELLTYPE = 0x18, // wrong celltype {0} at slotOffset {1}\n- ERR_IEEE154_UNSUPPORTED = 0x19, // unsupported IEEE802.15.4 parameter {1} at location {0}\n- ERR_DESYNCHRONIZED = 0x1a, // got desynchronized at slotOffset {0}\n- ERR_SYNCHRONIZED = 0x1b, // synchronized at slotOffset {0}\n- ERR_LARGE_TIMECORRECTION = 0x1c, // large timeCorr.: {0} ticks (code loc. {1})\n- ERR_WRONG_STATE_IN_ENDFRAME_SYNC = 0x1d, // wrong state {0} in end of frame+sync\n- ERR_WRONG_STATE_IN_STARTSLOT = 0x1e, // wrong state {0} in startSlot, at slotOffset {1}\n- ERR_WRONG_STATE_IN_TIMERFIRES = 0x1f, // wrong state {0} in timer fires, at slotOffset {1}\n- ERR_WRONG_STATE_IN_NEWSLOT = 0x20, // wrong state {0} in start of frame, at slotOffset {1}\n- ERR_WRONG_STATE_IN_ENDOFFRAME = 0x21, // wrong state {0} in end of frame, at slotOffset {1}\n- ERR_MAXTXDATAPREPARE_OVERFLOW = 0x22, // maxTxDataPrepare overflows while at state {0} in slotOffset {1}\n- ERR_MAXRXACKPREPARE_OVERFLOWS = 0x23, // maxRxAckPrepapare overflows while at state {0} in slotOffset {1}\n- ERR_MAXRXDATAPREPARE_OVERFLOWS = 0x24, // maxRxDataPrepapre overflows while at state {0} in slotOffset {1}\n- ERR_MAXTXACKPREPARE_OVERFLOWS = 0x25, // maxTxAckPrepapre overflows while at state {0} in slotOffset {1}\n- ERR_WDDATADURATION_OVERFLOWS = 0x26, // wdDataDuration overflows while at state {0} in slotOffset {1}\n- ERR_WDRADIO_OVERFLOWS = 0x27, // wdRadio overflows while at state {0} in slotOffset {1}\n- ERR_WDRADIOTX_OVERFLOWS = 0x28, // wdRadioTx overflows while at state {0} in slotOffset {1}\n- ERR_WDACKDURATION_OVERFLOWS = 0x29, // wdAckDuration overflows while at state {0} in slotOffset {1}\n+ ERR_WRONG_CELLTYPE = 0x19, // wrong celltype {0} at slotOffset {1}\n+ ERR_IEEE154_UNSUPPORTED = 0x1a, // unsupported IEEE802.15.4 parameter {1} at location {0}\n+ ERR_DESYNCHRONIZED = 0x1b, // got desynchronized at slotOffset {0}\n+ ERR_SYNCHRONIZED = 0x1c, // synchronized at slotOffset {0}\n+ ERR_LARGE_TIMECORRECTION = 0x1d, // large timeCorr.: {0} ticks (code loc. {1})\n+ ERR_WRONG_STATE_IN_ENDFRAME_SYNC = 0x1e, // wrong state {0} in end of frame+sync\n+ ERR_WRONG_STATE_IN_STARTSLOT = 0x1f, // wrong state {0} in startSlot, at slotOffset {1}\n+ ERR_WRONG_STATE_IN_TIMERFIRES = 0x20, // wrong state {0} in timer fires, at slotOffset {1}\n+ ERR_WRONG_STATE_IN_NEWSLOT = 0x21, // wrong state {0} in start of frame, at slotOffset {1}\n+ ERR_WRONG_STATE_IN_ENDOFFRAME = 0x22, // wrong state {0} in end of frame, at slotOffset {1}\n+ ERR_MAXTXDATAPREPARE_OVERFLOW = 0x23, // maxTxDataPrepare overflows while at state {0} in slotOffset {1}\n+ ERR_MAXRXACKPREPARE_OVERFLOWS = 0x24, // maxRxAckPrepapare overflows while at state {0} in slotOffset {1}\n+ ERR_MAXRXDATAPREPARE_OVERFLOWS = 0x25, // maxRxDataPrepapre overflows while at state {0} in slotOffset {1}\n+ ERR_MAXTXACKPREPARE_OVERFLOWS = 0x26, // maxTxAckPrepapre overflows while at state {0} in slotOffset {1}\n+ ERR_WDDATADURATION_OVERFLOWS = 0x27, // wdDataDuration overflows while at state {0} in slotOffset {1}\n+ ERR_WDRADIO_OVERFLOWS = 0x28, // wdRadio overflows while at state {0} in slotOffset {1}\n+ ERR_WDRADIOTX_OVERFLOWS = 0x29, // wdRadioTx overflows while at state {0} in slotOffset {1}\n+ ERR_WDACKDURATION_OVERFLOWS = 0x2a, // wdAckDuration overflows while at state {0} in slotOffset {1}\n// general\n- ERR_BUSY_SENDING = 0x2a, // busy sending\n- ERR_UNEXPECTED_SENDDONE = 0x2b, // sendDone for packet I didn't send\n- ERR_NO_FREE_PACKET_BUFFER = 0x2c, // no free packet buffer (code location {0})\n- ERR_FREEING_UNUSED = 0x2d, // freeing unused memory\n- ERR_FREEING_ERROR = 0x2e, // freeing memory unsupported memory\n- ERR_UNSUPPORTED_COMMAND = 0x2f, // unsupported command {0}\n- ERR_MSG_UNKNOWN_TYPE = 0x30, // unknown message type {0}\n- ERR_WRONG_ADDR_TYPE = 0x31, // wrong address type {0} (code location {1})\n- ERR_BRIDGE_MISMATCH = 0x32, // bridge mismatch (code location {0})\n- ERR_HEADER_TOO_LONG = 0x33, // header too long, length {1} (code location {0})\n- ERR_INPUTBUFFER_LENGTH = 0x34, // input length problem, length={0}\n- ERR_BOOTED = 0x35, // booted\n- ERR_INVALIDSERIALFRAME = 0x36, // invalid serial frame\n- ERR_INVALIDPACKETFROMRADIO = 0x37, // invalid packet frome radio, length {1} (code location {0})\n- ERR_BUSY_RECEIVING = 0x38, // busy receiving when stop of serial activity, buffer input length {1} (code location {0})\n- ERR_WRONG_CRC_INPUT = 0x39, // wrong CRC in input Buffer\n- ERR_PACKET_SYNC = 0x3a, // synchronized when received a packet\n- ERR_SECURITY = 0x3b, // security error on frameType {0}, code location {1}\n- ERR_SIXTOP_RETURNCODE = 0x3c, // sixtop return code {0} at sixtop state {1}\n- ERR_SIXTOP_COUNT = 0x3d, // there are {0} cells to request mote\n- ERR_SIXTOP_LIST = 0x3e, // the cells reserved to request mote contains slot {0} and slot {1}\n- ERR_SCHEDULE_ADDDUPLICATESLOT = 0x3f, // the slot {0} to be added is already in schedule\n- ERR_UNSUPPORTED_FORMAT = 0x40, // the received packet format is not supported (code location {0})\n- ERR_UNSUPPORTED_METADATA = 0x41, // the metadata type is not suppored\n+ ERR_BUSY_SENDING = 0x2b, // busy sending\n+ ERR_UNEXPECTED_SENDDONE = 0x2c, // sendDone for packet I didn't send\n+ ERR_NO_FREE_PACKET_BUFFER = 0x2d, // no free packet buffer (code location {0})\n+ ERR_FREEING_UNUSED = 0x2e, // freeing unused memory\n+ ERR_FREEING_ERROR = 0x2f, // freeing memory unsupported memory\n+ ERR_UNSUPPORTED_COMMAND = 0x30, // unsupported command {0}\n+ ERR_MSG_UNKNOWN_TYPE = 0x31, // unknown message type {0}\n+ ERR_WRONG_ADDR_TYPE = 0x32, // wrong address type {0} (code location {1})\n+ ERR_BRIDGE_MISMATCH = 0x33, // bridge mismatch (code location {0})\n+ ERR_HEADER_TOO_LONG = 0x34, // header too long, length {1} (code location {0})\n+ ERR_INPUTBUFFER_LENGTH = 0x35, // input length problem, length={0}\n+ ERR_BOOTED = 0x36, // booted\n+ ERR_INVALIDSERIALFRAME = 0x37, // invalid serial frame\n+ ERR_INVALIDPACKETFROMRADIO = 0x38, // invalid packet frome radio, length {1} (code location {0})\n+ ERR_BUSY_RECEIVING = 0x39, // busy receiving when stop of serial activity, buffer input length {1} (code location {0})\n+ ERR_WRONG_CRC_INPUT = 0x3a, // wrong CRC in input Buffer\n+ ERR_PACKET_SYNC = 0x3b, // synchronized when received a packet\n+ ERR_SECURITY = 0x3c, // security error on frameType {0}, code location {1}\n+ ERR_SIXTOP_RETURNCODE = 0x3d, // sixtop return code {0} at sixtop state {1}\n+ ERR_SIXTOP_COUNT = 0x3e, // there are {0} cells to request mote\n+ ERR_SIXTOP_LIST = 0x3f, // the cells reserved to request mote contains slot {0} and slot {1}\n+ ERR_SCHEDULE_ADDDUPLICATESLOT = 0x40, // the slot {0} to be added is already in schedule\n+ ERR_UNSUPPORTED_FORMAT = 0x41, // the received packet format is not supported (code location {0})\n+ ERR_UNSUPPORTED_METADATA = 0x42, // the metadata type is not suppored\n//l3\n- ERR_6LORH_DEADLINE_EXPIRED = 0x42, // the received packet has expired\n- ERR_6LORH_DEADLINE_DROPPED = 0x43, // packet expiry time reached, dropped\n+ ERR_6LORH_DEADLINE_EXPIRED = 0x43, // the received packet has expired\n+ ERR_6LORH_DEADLINE_DROPPED = 0x44, // packet expiry time reached, dropped\n// join and OSCOAP\n- ERR_JOINED = 0x44, // node joined\n- ERR_SEQUENCE_NUMBER_OVERFLOW = 0x45, // OSCOAP sequence number reached maximum value\n- ERR_BUFFER_OVERFLOW = 0x46, // OSCOAP buffer overflow detected (code location {0})\n- ERR_REPLAY_FAILED = 0x47, // OSCOAP replay protection failed\n- ERR_DECRYPTION_FAILED = 0x48, // OSCOAP decryption and tag verification failed\n- ERR_ABORT_JOIN_PROCESS = 0x49, // Aborted join process (code location {0})\n+ ERR_JOINED = 0x45, // node joined\n+ ERR_SEQUENCE_NUMBER_OVERFLOW = 0x46, // OSCOAP sequence number reached maximum value\n+ ERR_BUFFER_OVERFLOW = 0x47, // OSCOAP buffer overflow detected (code location {0})\n+ ERR_REPLAY_FAILED = 0x48, // OSCOAP replay protection failed\n+ ERR_DECRYPTION_FAILED = 0x49, // OSCOAP decryption and tag verification failed\n+ ERR_ABORT_JOIN_PROCESS = 0x4a, // Aborted join process (code location {0})\n};\n//=========================== typedef =========================================\n@@ -340,6 +341,7 @@ typedef struct {\nuint8_t l2_sixtop_cellOptions; // celloptions, used when 6p response senddone. (it's the same with cellOptions in 6p request but with TX and RX bits have been flipped)\nuint8_t l2_sixtop_returnCode; // return code in 6P response\nuint8_t* l2_ASNpayload; // pointer to the ASN in EB\n+ uint8_t* l2_nextHop_payload; // pointer to the nexthop address in frame\nuint8_t l2_joinPriority; // the join priority received in EB\nbool l2_IEListPresent; // did have IE field?\nbool l2_payloadIEpresent; // did I have payload IE field\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154.c",
"new_path": "openstack/02a-MAClow/IEEE802154.c",
"diff": "@@ -128,6 +128,9 @@ void ieee802154_prependHeader(OpenQueueEntry_t* msg,\n}\n}\n+\n+ msg->l2_nextHop_payload = msg->payload;\n+\n// destpan -- se page 41 of 15.4-2011 std. DEST PANID only sent as it is equal to SRC PANID\npacketfunctions_writeAddress(msg,idmanager_getMyID(ADDR_PANID),OW_LITTLE_ENDIAN);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -356,6 +356,12 @@ void forwarding_receive(\n// after change the creator to COMPONENT_FORWARDING,\n// there is no space for high priority packet, drop this message\n// by free the buffer.\n+ openserial_printError(\n+ COMPONENT_FORWARDING,\n+ ERR_FORWARDING_DROPPED,\n+ (errorparameter_t)msg->l2_nextORpreviousHop.addr_64b[6],\n+ (errorparameter_t)msg->l2_nextORpreviousHop.addr_64b[7]\n+ );\nopenqueue_freePacketBuffer(msg);\nreturn;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -386,6 +386,8 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\ndagrank_t neighborRank;\nuint32_t tentativeDAGrank;\n+ open_addr_t newParent;\n+\n// if I'm a DAGroot, my DAGrank is always MINHOPRANKINCREASE\nif ((idmanager_getIsDAGroot())==TRUE) {\n// the dagrank is not set through setting command, set rank to MINHOPRANKINCREASE here\n@@ -469,6 +471,12 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\nneighbors_setPreferredParent(prevParentIndex, FALSE);\n// set neighbors as preferred parent\nneighbors_setPreferredParent(icmpv6rpl_vars.ParentIndex, TRUE);\n+\n+ // update the upstream traffic nexthop address to new parent\n+ neighbors_getNeighborEui64(&newParent,ADDR_64B,icmpv6rpl_vars.ParentIndex);\n+ icmpv6rpl_updateNexthopAddress(&newParent);\n+\n+\n} else {\nif (icmpv6rpl_vars.ParentIndex==prevParentIndex) {\n// report on the rank change if any, not on the deletion/creation of parent\n@@ -481,6 +489,10 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\nneighbors_setPreferredParent(prevParentIndex, FALSE);\n// set neighbors as preferred parent\nneighbors_setPreferredParent(icmpv6rpl_vars.ParentIndex, TRUE);\n+\n+ // update the upstream traffic nexthop address to new parent\n+ neighbors_getNeighborEui64(&newParent,ADDR_64B,icmpv6rpl_vars.ParentIndex);\n+ icmpv6rpl_updateNexthopAddress(&newParent);\n}\n}\n} else {\n@@ -493,6 +505,16 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\n}\n}\n+/**\n+\\brief In case of parent changed, update the nexthop of the IPv6 packet in the queue\n+\n+\\param newParent. the new parent address\n+*/\n+void icmpv6rpl_updateNexthopAddress(open_addr_t* newParent){\n+\n+ openqueue_updateNextHopPayload(newParent);\n+}\n+\n/**\n\\brief Indicate I just received a RPL DIO from a neighbor.\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.h",
"new_path": "openstack/03b-IPv6/icmpv6rpl.h",
"diff": "@@ -220,6 +220,7 @@ void icmpv6rpl_setDIOPeriod(uint16_t dioPeriod);\nvoid icmpv6rpl_setDAOPeriod(uint16_t daoPeriod);\nbool icmpv6rpl_getPreferredParentIndex(uint8_t* indexptr);\nbool icmpv6rpl_getPreferredParentEui64(open_addr_t* addressToWrite);\n+void icmpv6rpl_updateNexthopAddress(open_addr_t* addressToWrite);\nbool icmpv6rpl_isPreferredParent(open_addr_t* address);\ndagrank_t icmpv6rpl_getMyDAGrank(void);\nvoid icmpv6rpl_setMyDAGrank(dagrank_t rank);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -321,6 +321,38 @@ OpenQueueEntry_t* openqueue_macGetDIOPacket(){\nENABLE_INTERRUPTS();\nreturn NULL;\n}\n+/**\n+\\Brief replace the upstream packet nexthop payload by given newNextHop address\n+\\param newNextHop.\n+*/\n+void openqueue_updateNextHopPayload(open_addr_t* newNextHop){\n+\n+ uint8_t i,j;\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ for (i=0;i<QUEUELENGTH;i++) {\n+ if (\n+ openqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n+ (\n+ newNextHop->type==ADDR_64B &&\n+ packetfunctions_sameAddress(newNextHop,&openqueue_vars.queue[i].l2_nextORpreviousHop) == FALSE\n+ )\n+ ){\n+ if (\n+ openqueue_vars.queue[i].creator >= COMPONENT_FORWARDING &&\n+ openqueue_vars.queue[i].l3_useSourceRouting == FALSE\n+ ) {\n+ memcpy(&openqueue_vars.queue[i].l2_nextORpreviousHop, newNextHop, sizeof(open_addr_t));\n+ for (j=0;j<8;j++) {\n+ *((uint8_t*)openqueue_vars.queue[i].l2_nextHop_payload+j) = newNextHop->addr_64b[j];\n+ }\n+ }\n+ }\n+ }\n+\n+ ENABLE_INTERRUPTS();\n+}\nOpenQueueEntry_t* openqueue_macGetNonJoinIPv6Packet(open_addr_t* toNeighbor){\nuint8_t i;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.h",
"new_path": "openstack/cross-layers/openqueue.h",
"diff": "@@ -38,6 +38,8 @@ OpenQueueEntry_t* openqueue_getFreePacketBuffer(uint8_t creator);\nowerror_t openqueue_freePacketBuffer(OpenQueueEntry_t* pkt);\nvoid openqueue_removeAllCreatedBy(uint8_t creator);\nbool openqueue_isHighPriorityEntryEnough(void);\n+// called by ICMPv6\n+void openqueue_updateNextHopPayload(open_addr_t* newNextHop);\n// called by res\nOpenQueueEntry_t* openqueue_sixtopGetSentPacket(void);\nOpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -747,6 +747,7 @@ functionsToChange = [\n'icmpv6rpl_getMyDAGrank',\n'icmpv6rpl_setMyDAGrank',\n'icmpv6rpl_updateMyDAGrankAndParentSelection',\n+ 'icmpv6rpl_updateNexthopAddress',\n'icmpv6rpl_indicateRxDIO',\n'icmpv6rpl_killPreferredParent',\n'icmpv6rpl_timer_DIO_cb',\n@@ -831,6 +832,7 @@ functionsToChange = [\n'openqueue_macGetDIOPacket',\n'openqueue_macGetNonJoinIPv6Packet',\n'openqueue_macGet6PandJoinPacket',\n+ 'openqueue_updateNextHopPayload',\n# openrandom\n'openrandom_init',\n'openrandom_get16b',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-812. change the nexthop payload for upstream IPv6 packets.
|
491,595 |
09.03.2019 08:43:50
| -3,600 |
604e8196386398aa957403f4ce0ad7ba2413495f
|
randomize the period of DAO.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "@@ -203,7 +203,7 @@ enum {\nERR_HOP_LIMIT_REACHED = 0x11, // packet discarded hop limit reached\nERR_LOOP_DETECTED = 0x12, // loop detected due to previous rank {0} lower than current node rank {1}\nERR_WRONG_DIRECTION = 0x13, // upstream packet set to be downstream, possible loop.\n- ERR_FORWARDING_PACKET_DROPPED = 0x14, // the forwarding packet received from mote {0:x}{1:x} is dropped because of queue buffer is full\n+ ERR_FORWARDING_PACKET_DROPPED = 0x14, // packet received from mote {0:x}{1:x} is dropped\n// l2b\nERR_NEIGHBORS_FULL = 0x15, // neighbors table is full (max number of neighbor is {0})\nERR_NO_SENT_PACKET = 0x16, // there is no sent packet in queue\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -756,8 +756,7 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\nif (!isValidJoin(ieee154e_vars.dataReceived, &ieee802514_header)) {\nbreak;\n}\n- }\n- else { // discard other frames as we cannot decrypt without being synced\n+ } else { // discard other frames as we cannot decrypt without being synced\nbreak;\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "//=========================== definition ======================================\n#define DIO_PORTION 10\n+#define DAO_PORTION 30\n//=========================== variables =======================================\n@@ -177,7 +178,7 @@ void icmpv6rpl_init(void) {\nicmpv6rpl_vars.timerIdDAO = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_RPL);\nopentimers_scheduleIn(\nicmpv6rpl_vars.timerIdDAO,\n- icmpv6rpl_vars.daoPeriod,\n+ SLOTFRAME_LENGTH*SLOTDURATION,\nTIME_MS,\nTIMER_PERIODIC,\nicmpv6rpl_timer_DAO_cb\n@@ -824,8 +825,10 @@ void icmpv6rpl_timer_DAO_cb(opentimers_id_t id) {\n*/\nvoid icmpv6rpl_timer_DAO_task(void) {\n+ if(openrandom_get16b()<(0xffff/DAO_PORTION)){\nsendDAO();\n}\n+}\n/**\n\\brief Prepare and a send a RPL DAO.\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-812. randomize the period of DAO.
|
491,595 |
09.03.2019 09:33:35
| -3,600 |
cc385d361259723975c8695e9a01b5297af292b6
|
drop the 6p response with RESET return code to avoid queue buffer overflow.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "// in seconds: sixtop maintaince is called every 30 seconds\n#define MAINTENANCE_PERIOD 30\n+/**\n+ Drop the 6P request if number of 6P response with RC RESET in queue is larger\n+ than MAX6PRESPONSE. Value 0 means that alway drop 6P response when the node\n+ is in a 6P transcation.\n+*/\n+#define MAX6PRESPONSE 0\n//=========================== variables =======================================\n@@ -1161,9 +1167,17 @@ void sixtop_six2six_notifyReceive(\n}\n// previous 6p transcation check\nif (sixtop_vars.six2six_state != SIX_STATE_IDLE){\n+ if (openqueue_getNum6PRespWithRC(IANA_6TOP_RC_RESET)>=MAX6PRESPONSE) {\n+ // too many 6P resp with RESET return code\n+\n+ // drop the packet to avoid queue buffer overflow\n+ openqueue_freePacketBuffer(response_pkt);\n+ return;\n+ } else {\nreturnCode = IANA_6TOP_RC_RESET;\nbreak;\n}\n+ }\n// metadata meaning check\nif (sixtop_vars.cb_sf_translateMetadata()!=METADATA_TYPE_FRAMEID){\nopenserial_printError(\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -181,6 +181,29 @@ OpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void) {\nreturn NULL;\n}\n+uint8_t openqueue_getNum6PRespWithRC(uint8_t returnCode){\n+\n+ uint8_t i;\n+ uint8_t num6Presponse;\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ num6Presponse = 0;\n+ for (i=0;i<QUEUELENGTH;i++) {\n+ if (\n+ openqueue_vars.queue[i].owner == COMPONENT_IEEE802154E_TO_SIXTOP &&\n+ openqueue_vars.queue[i].creator == COMPONENT_SIXTOP_RES &&\n+ openqueue_vars.queue[i].l2_sixtop_command == SIXTOP_CELL_RESPONSE &&\n+ openqueue_vars.queue[i].l2_sixtop_returnCode == IANA_6TOP_RC_RESET\n+ ) {\n+ num6Presponse += 1;\n+ }\n+ }\n+ ENABLE_INTERRUPTS();\n+ return num6Presponse;\n+}\n+\n//======= called by IEEE80215E\nOpenQueueEntry_t* openqueue_macGet6PResponseAndDownStreamPacket(open_addr_t* toNeighbor) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.h",
"new_path": "openstack/cross-layers/openqueue.h",
"diff": "@@ -43,6 +43,7 @@ void openqueue_updateNextHopPayload(open_addr_t* newNextHop);\n// called by res\nOpenQueueEntry_t* openqueue_sixtopGetSentPacket(void);\nOpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void);\n+uint8_t openqueue_getNum6PRespWithRC(uint8_t returnCode);\n// called by IEEE80215E\nOpenQueueEntry_t* openqueue_macGet6PResponseAndDownStreamPacket(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGet6PRequestOnAnycast(open_addr_t* autonomousUnicastNeighbor);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -833,6 +833,7 @@ functionsToChange = [\n'openqueue_macGetNonJoinIPv6Packet',\n'openqueue_macGet6PandJoinPacket',\n'openqueue_updateNextHopPayload',\n+ 'openqueue_getNum6PRespWithRC',\n# openrandom\n'openrandom_init',\n'openrandom_get16b',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-812. drop the 6p response with RESET return code to avoid queue buffer overflow.
|
491,595 |
09.03.2019 15:51:09
| -3,600 |
37abaac1cd2ad60f1b78a3bf762021ece4b00164
|
count numTx and numTxAck only on Tx cell.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "@@ -348,6 +348,7 @@ typedef struct {\nbool l2_joinPriorityPresent;\nbool l2_isNegativeACK; // is the negative ACK?\nint16_t l2_timeCorrection; // record the timeCorrection and print out at endOfslot\n+ bool l2_sendOnTxCell; // mark the frame is sent on txCell\n//layer-2 security\nuint8_t l2_securityLevel; // the security level specified for the current frame\nuint8_t l2_keyIdMode; // the key Identifier mode specified for the current frame\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/openapps.c",
"new_path": "openapps/openapps.c",
"diff": "@@ -43,7 +43,7 @@ void openapps_init(void) {\n// UDP\n//uecho_init();\n- uinject_init();\n+ // uinject_init();\n//userialbridge_init();\n//uexpiration_init();\n//umonitor_init();\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -977,6 +977,7 @@ port_INLINE void activity_ti1ORri1(void) {\n// update numcellpassed and numcellused on managed Tx cell\nif (ieee154e_vars.dataToSend!=NULL) {\n+ ieee154e_vars.dataToSend->l2_sendOnTxCell = TRUE;\nmsf_updateCellsUsed(&neighbor);\n}\nmsf_updateCellsPassed(&neighbor);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -410,6 +410,7 @@ The fields which are updated are:\nvoid neighbors_indicateTx(\nopen_addr_t* l2_dest,\nuint8_t numTxAttempts,\n+ bool sentOnTxCell,\nbool was_finally_acked,\nasn_t* asnTs\n) {\n@@ -422,8 +423,15 @@ void neighbors_indicateTx(\n// loop through neighbor table\nfor (i=0;i<MAXNUMNEIGHBORS;i++) {\nif (isThisRowMatching(l2_dest,i)) {\n- // handle roll-over case\n+ // found the target neighbor\n+ // update asn if ack'ed\n+ if (was_finally_acked==TRUE) {\n+ memcpy(&neighbors_vars.neighbors[i].asn,asnTs,sizeof(asn_t));\n+ }\n+\n+ // only update numTx/numTxAck on Tx cell\n+ if (sentOnTxCell) {\nif (neighbors_vars.neighbors[i].numTx>(0xff-numTxAttempts)) {\nneighbors_vars.neighbors[i].numWraps++; //counting the number of times that tx wraps.\nneighbors_vars.neighbors[i].numTx/=2;\n@@ -434,11 +442,11 @@ void neighbors_indicateTx(\nif (was_finally_acked==TRUE) {\nneighbors_vars.neighbors[i].numTxACK++;\n- memcpy(&neighbors_vars.neighbors[i].asn,asnTs,sizeof(asn_t));\n}\n// numTx and numTxAck changed,, update my rank\nicmpv6rpl_updateMyDAGrankAndParentSelection();\n+ }\nbreak;\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.h",
"new_path": "openstack/02b-MAChigh/neighbors.h",
"diff": "@@ -92,6 +92,7 @@ void neighbors_indicateRx(\nvoid neighbors_indicateTx(\nopen_addr_t* dest,\nuint8_t numTxAttempts,\n+ bool sentOnTxCell,\nbool was_finally_acked,\nasn_t* asnTimestamp\n);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "than MAX6PRESPONSE. Value 0 means that alway drop 6P response when the node\nis in a 6P transcation.\n*/\n-#define MAX6PRESPONSE 0\n+#define MAX6PRESPONSE 1\n//=========================== variables =======================================\n@@ -426,6 +426,7 @@ void task_sixtopNotifSendDone(void) {\nneighbors_indicateTx(\n&(msg->l2_nextORpreviousHop),\nmsg->l2_numTxAttempts,\n+ msg->l2_sendOnTxCell,\nTRUE,\n&msg->l2_asn\n);\n@@ -433,6 +434,7 @@ void task_sixtopNotifSendDone(void) {\nneighbors_indicateTx(\n&(msg->l2_nextORpreviousHop),\nmsg->l2_numTxAttempts,\n+ msg->l2_sendOnTxCell,\nFALSE,\n&msg->l2_asn\n);\n@@ -1127,6 +1129,11 @@ void sixtop_six2six_notifyReceive(\nif (type == SIXTOP_CELL_REQUEST){\n// if this is a 6p request message\n+ // drop the packet if there are too many 6P response in the queue\n+ if (openqueue_getNum6PResp()>=MAX6PRESPONSE) {\n+ return;\n+ }\n+\n// get a free packet buffer\nresponse_pkt = openqueue_getFreePacketBuffer(COMPONENT_SIXTOP_RES);\nif (response_pkt==NULL) {\n@@ -1167,17 +1174,9 @@ void sixtop_six2six_notifyReceive(\n}\n// previous 6p transcation check\nif (sixtop_vars.six2six_state != SIX_STATE_IDLE){\n- if (openqueue_getNum6PRespWithRC(IANA_6TOP_RC_RESET)>=MAX6PRESPONSE) {\n- // too many 6P resp with RESET return code\n-\n- // drop the packet to avoid queue buffer overflow\n- openqueue_freePacketBuffer(response_pkt);\n- return;\n- } else {\nreturnCode = IANA_6TOP_RC_RESET;\nbreak;\n}\n- }\n// metadata meaning check\nif (sixtop_vars.cb_sf_translateMetadata()!=METADATA_TYPE_FRAMEID){\nopenserial_printError(\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -181,7 +181,7 @@ OpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void) {\nreturn NULL;\n}\n-uint8_t openqueue_getNum6PRespWithRC(uint8_t returnCode){\n+uint8_t openqueue_getNum6PResp(void){\nuint8_t i;\nuint8_t num6Presponse;\n@@ -194,8 +194,7 @@ uint8_t openqueue_getNum6PRespWithRC(uint8_t returnCode){\nif (\nopenqueue_vars.queue[i].owner == COMPONENT_IEEE802154E_TO_SIXTOP &&\nopenqueue_vars.queue[i].creator == COMPONENT_SIXTOP_RES &&\n- openqueue_vars.queue[i].l2_sixtop_command == SIXTOP_CELL_RESPONSE &&\n- openqueue_vars.queue[i].l2_sixtop_returnCode == IANA_6TOP_RC_RESET\n+ openqueue_vars.queue[i].l2_sixtop_command == SIXTOP_CELL_RESPONSE\n) {\nnum6Presponse += 1;\n}\n@@ -467,6 +466,7 @@ void openqueue_reset_entry(OpenQueueEntry_t* entry) {\nentry->l2_IEListPresent = 0;\nentry->l2_isNegativeACK = 0;\nentry->l2_payloadIEpresent = 0;\n+ entry->l2_sendOnTxCell = FALSE;\n//l2-security\nentry->l2_securityLevel = 0;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.h",
"new_path": "openstack/cross-layers/openqueue.h",
"diff": "@@ -43,7 +43,7 @@ void openqueue_updateNextHopPayload(open_addr_t* newNextHop);\n// called by res\nOpenQueueEntry_t* openqueue_sixtopGetSentPacket(void);\nOpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void);\n-uint8_t openqueue_getNum6PRespWithRC(uint8_t returnCode);\n+uint8_t openqueue_getNum6PResp(void);\n// called by IEEE80215E\nOpenQueueEntry_t* openqueue_macGet6PResponseAndDownStreamPacket(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGet6PRequestOnAnycast(open_addr_t* autonomousUnicastNeighbor);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-24ghz/03oos_openwsn/03oos_openwsn.ewp",
"new_path": "projects/openmote-b-24ghz/03oos_openwsn/03oos_openwsn.ewp",
"diff": "<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154_security.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\ieee802154_security_driver.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\openstack\\02a-MAClow\\IEEE802154E.c</name>\n</file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -833,7 +833,7 @@ functionsToChange = [\n'openqueue_macGetNonJoinIPv6Packet',\n'openqueue_macGet6PandJoinPacket',\n'openqueue_updateNextHopPayload',\n- 'openqueue_getNum6PRespWithRC',\n+ 'openqueue_getNum6PResp',\n# openrandom\n'openrandom_init',\n'openrandom_get16b',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-592. count numTx and numTxAck only on Tx cell.
|
491,595 |
10.03.2019 20:50:11
| -3,600 |
1248265a89bf076f829224beaa80cdab59f60b39
|
add the HashCollision case in sixtop_send.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -369,10 +369,13 @@ owerror_t sixtop_send(OpenQueueEntry_t *msg) {\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n(\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n+ (\n+ msf_getHashCollisionFlag() == FALSE &&\nschedule_hasAutonomousTxRxCellUnicast(&addressToWrite)== FALSE\n)\n)\n)\n+ )\n){\nreturn E_FAIL;\n}\n@@ -673,7 +676,7 @@ void sixtop_timeout_timer_cb(opentimers_id_t id) {\nvoid timer_sixtop_sendEb_fired(void) {\n- if(openrandom_get16b()<(0xffff/EB_PORTION)){\n+ if(openrandom_get16b()<(0xffff)){\nsixtop_sendEB();\n}\n}\n@@ -717,6 +720,7 @@ port_INLINE void sixtop_sendEB(void) {\nopen_addr_t addressToWrite;\nmemset(&addressToWrite,0,sizeof(open_addr_t));\n+\nif (\n(ieee154e_isSynch()==FALSE) ||\n(IEEE802154_security_isConfigured()==FALSE) ||\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-797. add the HashCollision case in sixtop_send.
|
491,595 |
11.03.2019 10:03:36
| -3,600 |
f090be5a87d3c3228f1d0cdaf86318adc358fb46
|
don't remove parent from neighbor table when cleaning old neighbors.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -654,8 +654,7 @@ uint16_t neighbors_getLinkMetric(uint8_t index) {\n//===== maintenance\nvoid neighbors_removeOld(void) {\n- uint8_t i, j;\n- bool haveParent;\n+ uint8_t i;\nPORT_TIMER_WIDTH timeSinceHeard;\nopen_addr_t addressToWrite;\n@@ -674,17 +673,21 @@ void neighbors_removeOld(void) {\nif (neighbors_vars.neighbors[i].used==1) {\ntimeSinceHeard = ieee154e_asnDiff(&neighbors_vars.neighbors[i].asn);\nif (timeSinceHeard>(2*DESYNCTIMEOUT)) {\n+\n+ /**\n+ don't remove neighbor marked as:\n+ - 6P no resource\n+ - in blacklist\n+ - pareferred parent\n+ */\n+\nif (\nneighbors_vars.neighbors[i].f6PNORES == FALSE &&\n- neighbors_vars.neighbors[i].inBlacklist == FALSE\n+ neighbors_vars.neighbors[i].inBlacklist == FALSE &&\n+ neighbors_vars.neighbors[i].parentPreference == 0\n){\nremoveNeighbor(i);\n}\n- haveParent = icmpv6rpl_getPreferredParentIndex(&j);\n- if (haveParent && (i==j)) { // this is our preferred parent, carefully!\n- icmpv6rpl_killPreferredParent();\n- icmpv6rpl_updateMyDAGrankAndParentSelection();\n- }\n}\n}\n}\n@@ -782,10 +785,6 @@ bool isNeighbor(open_addr_t* neighbor) {\nvoid removeNeighbor(uint8_t neighborIndex) {\n- uint16_t moteId;\n- uint16_t slotoffset;\n- uint16_t temp_slotoffset;\n-\nneighbors_vars.neighbors[neighborIndex].used = FALSE;\nneighbors_vars.neighbors[neighborIndex].parentPreference = 0;\nneighbors_vars.neighbors[neighborIndex].stableNeighbor = FALSE;\n@@ -802,26 +801,6 @@ void removeNeighbor(uint8_t neighborIndex) {\nneighbors_vars.neighbors[neighborIndex].sequenceNumber = 0;\nneighbors_vars.neighbors[neighborIndex].backoffExponenton = MINBE-1;;\nneighbors_vars.neighbors[neighborIndex].backoff = 0;\n-\n- if (\n- schedule_hasAutonomousTxRxCellUnicast(&(neighbors_vars.neighbors[neighborIndex].addr_64b))\n- ){\n- moteId = 256*neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[6]+\\\n- neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[7];\n- slotoffset = msf_hashFunction_getSlotoffset(moteId);\n- if (\n- schedule_getAutonomousTxRxCellAnycast(&temp_slotoffset) &&\n- slotoffset == temp_slotoffset\n- ) {\n- msf_setHashCollisionFlag(FALSE);\n- } else {\n- schedule_removeActiveSlot(\n- slotoffset, // slot offset\n- &(neighbors_vars.neighbors[neighborIndex].addr_64b) // neighbor\n- );\n- }\n- }\n-\nneighbors_vars.neighbors[neighborIndex].addr_64b.type = ADDR_NONE;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-816. don't remove parent from neighbor table when cleaning old neighbors.
|
491,595 |
12.03.2019 18:44:19
| -3,600 |
6fd0d0c6414cd3fcf9bc61ad08c8f5bb1391e912
|
push a task to call 6p.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -82,10 +82,10 @@ void msf_updateCellsPassed(open_addr_t* neighbor){\nmsf_vars.numCellsPassed++;\nif (msf_vars.numCellsPassed == MAX_NUMCELLS){\nif (msf_vars.numCellsUsed > LIM_NUMCELLSUSED_HIGH){\n- msf_trigger6pAdd();\n+ scheduler_push_task(msf_trigger6pAdd,TASKPRIO_MSF);\n}\nif (msf_vars.numCellsUsed < LIM_NUMCELLSUSED_LOW){\n- msf_trigger6pDelete();\n+ scheduler_push_task(msf_trigger6pDelete,TASKPRIO_MSF);\n}\nmsf_vars.numCellsPassed = 0;\nmsf_vars.numCellsUsed = 0;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-817. push a task to call 6p.
|
491,595 |
12.03.2019 18:46:20
| -3,600 |
32a0c800b2792c5dbd3a0be11a2416a896429d2d
|
reset neighbor backoff when packet sendDone
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -425,6 +425,10 @@ void neighbors_indicateTx(\nif (isThisRowMatching(l2_dest,i)) {\n// found the target neighbor\n+ // reset backoff variable\n+ neighbors_vars.neighbors[i].backoffExponenton = MINBE-1;\n+ neighbors_vars.neighbors[i].backoff = 0;\n+\n// update asn if ack'ed\nif (was_finally_acked==TRUE) {\nmemcpy(&neighbors_vars.neighbors[i].asn,asnTs,sizeof(asn_t));\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-818. reset neighbor backoff when packet sendDone
|
491,595 |
12.03.2019 18:48:01
| -3,600 |
065b57cb4b3ac2669e0209d89e69e430f76f2659
|
remove 6P request to that neighbor if received 6P from a wrong state.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -1491,7 +1491,6 @@ void sixtop_six2six_notifyReceive(\nif (type == SIXTOP_CELL_RESPONSE) {\n// this is a 6p response message\n- neighbors_updateSequenceNumber(&(pkt->l2_nextORpreviousHop));\n// if the code is SUCCESS\nif (code == IANA_6TOP_RC_SUCCESS || code == IANA_6TOP_RC_EOL){\n@@ -1515,6 +1514,7 @@ void sixtop_six2six_notifyReceive(\n&(pkt->l2_nextORpreviousHop), // neighbor that cells to be added to\nsixtop_vars.cellOptions // cell options\n);\n+ neighbors_updateSequenceNumber(&(pkt->l2_nextORpreviousHop));\nbreak;\ncase SIX_STATE_WAIT_DELETERESPONSE:\nsixtop_removeCells(\n@@ -1523,6 +1523,7 @@ void sixtop_six2six_notifyReceive(\n&(pkt->l2_nextORpreviousHop),\nsixtop_vars.cellOptions\n);\n+ neighbors_updateSequenceNumber(&(pkt->l2_nextORpreviousHop));\nbreak;\ncase SIX_STATE_WAIT_RELOCATERESPONSE:\ni = 0;\n@@ -1549,6 +1550,7 @@ void sixtop_six2six_notifyReceive(\n&(pkt->l2_nextORpreviousHop), // neighbor that cells to be added to\nsixtop_vars.cellOptions // cell options\n);\n+ neighbors_updateSequenceNumber(&(pkt->l2_nextORpreviousHop));\nbreak;\ncase SIX_STATE_WAIT_COUNTRESPONSE:\nnumCells = *((uint8_t*)(pkt->payload)+ptr);\n@@ -1560,6 +1562,7 @@ void sixtop_six2six_notifyReceive(\n(errorparameter_t)numCells,\n(errorparameter_t)sixtop_vars.six2six_state\n);\n+ neighbors_updateSequenceNumber(&(pkt->l2_nextORpreviousHop));\nbreak;\ncase SIX_STATE_WAIT_LISTRESPONSE:\ni = 0;\n@@ -1581,6 +1584,7 @@ void sixtop_six2six_notifyReceive(\n(errorparameter_t)celllist_list[0].slotoffset,\n(errorparameter_t)celllist_list[1].slotoffset\n);\n+ neighbors_updateSequenceNumber(&(pkt->l2_nextORpreviousHop));\nbreak;\ncase SIX_STATE_WAIT_CLEARRESPONSE:\nschedule_removeAllManagedUnicastCellsToNeighbor(\n@@ -1590,7 +1594,13 @@ void sixtop_six2six_notifyReceive(\nneighbors_resetSequenceNumber(&(pkt->l2_nextORpreviousHop));\nbreak;\ndefault:\n- // should neven happen\n+ // The sixtop response arrived after 6P TIMEOUT.\n+\n+\n+ // it's a duplicated response.\n+\n+ openqueue_remove6PrequestToNeighbor(&(pkt->l2_nextORpreviousHop));\n+\nbreak;\n}\n} else {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -203,6 +203,26 @@ uint8_t openqueue_getNum6PResp(void){\nreturn num6Presponse;\n}\n+void openqueue_remove6PrequestToNeighbor(open_addr_t* neighbor){\n+\n+ uint8_t i;\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ for (i=0;i<QUEUELENGTH;i++) {\n+ if (\n+ openqueue_vars.queue[i].owner == COMPONENT_IEEE802154E_TO_SIXTOP &&\n+ openqueue_vars.queue[i].creator == COMPONENT_SIXTOP_RES &&\n+ openqueue_vars.queue[i].l2_sixtop_messageType == SIXTOP_CELL_REQUEST &&\n+ packetfunctions_sameAddress(neighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop)\n+ ) {\n+ openqueue_reset_entry(&(openqueue_vars.queue[i]));\n+ }\n+ }\n+ ENABLE_INTERRUPTS();\n+}\n+\n//======= called by IEEE80215E\nOpenQueueEntry_t* openqueue_macGet6PResponseAndDownStreamPacket(open_addr_t* toNeighbor) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.h",
"new_path": "openstack/cross-layers/openqueue.h",
"diff": "@@ -44,6 +44,7 @@ void openqueue_updateNextHopPayload(open_addr_t* newNextHop);\nOpenQueueEntry_t* openqueue_sixtopGetSentPacket(void);\nOpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void);\nuint8_t openqueue_getNum6PResp(void);\n+void openqueue_remove6PrequestToNeighbor(open_addr_t* neighbor);\n// called by IEEE80215E\nOpenQueueEntry_t* openqueue_macGet6PResponseAndDownStreamPacket(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGet6PRequestOnAnycast(open_addr_t* autonomousUnicastNeighbor);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -834,6 +834,7 @@ functionsToChange = [\n'openqueue_macGet6PandJoinPacket',\n'openqueue_updateNextHopPayload',\n'openqueue_getNum6PResp',\n+ 'openqueue_remove6PrequestToNeighbor',\n# openrandom\n'openrandom_init',\n'openrandom_get16b',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-819. remove 6P request to that neighbor if received 6P from a wrong state.
|
491,595 |
14.03.2019 17:52:21
| -3,600 |
ead7264f7f17db906f047d9715810dd294a6e743
|
remove additional request.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -191,6 +191,11 @@ owerror_t sixtop_request(\nreturn E_FAIL;\n}\n+ if (openqueue_getNum6PReq(neighbor)>0){\n+ // remove previous request as it's not sent out\n+ openqueue_remove6PrequestToNeighbor(neighbor);\n+ }\n+\n// get a free packet buffer\npkt = openqueue_getFreePacketBuffer(COMPONENT_SIXTOP_RES);\nif (pkt==NULL) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -181,6 +181,29 @@ OpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void) {\nreturn NULL;\n}\n+uint8_t openqueue_getNum6PReq(open_addr_t* neighbor){\n+\n+ uint8_t i;\n+ uint8_t num6Prequest;\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ num6Prequest = 0;\n+ for (i=0;i<QUEUELENGTH;i++) {\n+ if (\n+ openqueue_vars.queue[i].owner == COMPONENT_IEEE802154E_TO_SIXTOP &&\n+ openqueue_vars.queue[i].creator == COMPONENT_SIXTOP_RES &&\n+ openqueue_vars.queue[i].l2_sixtop_messageType == SIXTOP_CELL_REQUEST&&\n+ packetfunctions_sameAddress(neighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop)\n+ ) {\n+ num6Prequest += 1;\n+ }\n+ }\n+ ENABLE_INTERRUPTS();\n+ return num6Prequest;\n+}\n+\nuint8_t openqueue_getNum6PResp(void){\nuint8_t i;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.h",
"new_path": "openstack/cross-layers/openqueue.h",
"diff": "@@ -44,6 +44,7 @@ void openqueue_updateNextHopPayload(open_addr_t* newNextHop);\nOpenQueueEntry_t* openqueue_sixtopGetSentPacket(void);\nOpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void);\nuint8_t openqueue_getNum6PResp(void);\n+uint8_t openqueue_getNum6PReq(open_addr_t* neighbor);\nvoid openqueue_remove6PrequestToNeighbor(open_addr_t* neighbor);\n// called by IEEE80215E\nOpenQueueEntry_t* openqueue_macGet6PResponseAndDownStreamPacket(open_addr_t* toNeighbor);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -834,6 +834,7 @@ functionsToChange = [\n'openqueue_macGet6PandJoinPacket',\n'openqueue_updateNextHopPayload',\n'openqueue_getNum6PResp',\n+ 'openqueue_getNum6PReq',\n'openqueue_remove6PrequestToNeighbor',\n# openrandom\n'openrandom_init',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-817. remove additional request.
|
491,595 |
14.03.2019 18:11:36
| -3,600 |
517b656f94ad20f4a26bc75b6f2e3bf8caf2e733
|
add cellUsage into uinject payload.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.c",
"new_path": "openapps/uinject/uinject.c",
"diff": "#include \"icmpv6rpl.h\"\n#include \"idmanager.h\"\n+#include \"msf.h\"\n+\n//=========================== variables =======================================\nuinject_vars_t uinject_vars;\n@@ -81,6 +83,7 @@ void uinject_timer_cb(opentimers_id_t id){\nvoid uinject_task_cb(void) {\nOpenQueueEntry_t* pkt;\nuint8_t asnArray[5];\n+ uint8_t numCellsUsed;\nopen_addr_t parentNeighbor;\nbool foundNeighbor;\n@@ -148,6 +151,10 @@ void uinject_task_cb(void) {\npkt->payload[3] = asnArray[3];\npkt->payload[4] = asnArray[4];\n+ packetfunctions_reserveHeaderSize(pkt,sizeof(uint8_t));\n+ numCellsUsed = msf_getPreviousNumCellsUsed();\n+ pkt->payload[0] = numCellsUsed;\n+\nif ((openudp_send(pkt))==E_FAIL) {\nopenqueue_freePacketBuffer(pkt);\n} else {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -81,6 +81,9 @@ void msf_updateCellsPassed(open_addr_t* neighbor){\nmsf_vars.numCellsPassed++;\nif (msf_vars.numCellsPassed == MAX_NUMCELLS){\n+\n+ msf_vars.previousNumCellsUsed = msf_vars.numCellsUsed;\n+\nif (msf_vars.numCellsUsed > LIM_NUMCELLSUSED_HIGH){\nscheduler_push_task(msf_trigger6pAdd,TASKPRIO_MSF);\n}\n@@ -514,3 +517,7 @@ void msf_setHashCollisionFlag(bool isCollision){\nbool msf_getHashCollisionFlag(void){\nreturn msf_vars.f_hashCollision;\n}\n+\n+uint8_t msf_getPreviousNumCellsUsed(void){\n+ return msf_vars.previousNumCellsUsed;\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.h",
"new_path": "openstack/02b-MAChigh/msf.h",
"diff": "@@ -37,6 +37,8 @@ typedef struct {\nuint16_t housekeepingPeriod;\nopentimers_id_t waitretryTimerId;\nbool waitretry;\n+\n+ uint8_t previousNumCellsUsed;\n} msf_vars_t;\n//=========================== module variables ================================\n@@ -67,6 +69,8 @@ uint8_t msf_hashFunction_getChanneloffset(uint16_t moteId);\nvoid msf_setHashCollisionFlag(bool isCollision);\nbool msf_getHashCollisionFlag(void);\n+\n+uint8_t msf_getPreviousNumCellsUsed(void);\n/**\n\\}\n\\}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
add cellUsage into uinject payload.
|
491,595 |
14.03.2019 20:39:43
| -3,600 |
c5594e43a5269ea9c20e41aaae46afbeb19499df
|
update cell usage figure
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.py",
"new_path": "openapps/uinject/uinject.py",
"diff": "import socket\nimport struct\n+import time\n+\n+import matplotlib.pyplot as plt\n+import numpy as np\n+\n+# ================= definitions ===============================================\n+\n+NUM_CELLS_ELAPSED = 64\n+NUM_CELLS_USAGE_HIGH = 48\n+NUM_CELLS_USAGE_LOW = 16\n+\n+SLOTDURATION = 0.02 # second\n+\n+EXP_DURATION = 3 # in hour\n+mote_counter_asn_cellusage = {}\n+\n+# get data from file?\n+\n+fromFile = raw_input(\"get data from file? (yes, no):\")\n+\n+if fromFile == 'yes':\n+\n+ with open('mote_counter_asn_cellusage.log','r') as f:\n+ line_list = f.readlines()\n+ mote_counter_asn_cellusage = eval(line_list[-1])\n+else:\n+\n+ # get the network start time\n+ raw_input(\"Press Enter at the same time when network starts...\")\n+ network_start_time = time.time()\n+ print \"Network starts at {0}\\n\".format(time.ctime(network_start_time))\n+\n# open socket\nsocket_handler = socket.socket(socket.AF_INET6,socket.SOCK_DGRAM)\nsocket_handler.bind(('',61617))\n+ previous_time = time.time()\n+\nwhile True:\n# wait for a request\n@@ -13,8 +47,118 @@ while True:\nhisAddress = dist_addr[0]\nhisPort = dist_addr[1]\n- asn = struct.unpack('<HHB',request[-14:-9])\n- counter = struct.unpack('<h',request[-9:-7])\n+ numCellsUsed = ord(request[-15])\n+ asnBytes = struct.unpack('<HHB',request[-14:-9])\n+ counterBytes = struct.unpack('<h',request[-9:-7])\n+\n+ asn = asnBytes[2] * 65536 * 65536 + asnBytes[1] * 65536 + asnBytes[0]\n+ counter = counterBytes[0]\n+\n+ # record data to dictionary\n+ mote = hisAddress.split(':')[-1]\n+\n+ if mote not in mote_counter_asn_cellusage.keys():\n+ mote_counter_asn_cellusage[mote] = {}\n+ mote_counter_asn_cellusage[mote]['counter'] = []\n+ mote_counter_asn_cellusage[mote]['latency'] = []\n+ mote_counter_asn_cellusage[mote]['numCellsUsed'] = []\n+\n+ mote_counter_asn_cellusage[mote]['counter'].append(counter)\n+ mote_counter_asn_cellusage[mote]['latency'].append(time.time()-asn*SLOTDURATION-network_start_time)\n+ mote_counter_asn_cellusage[mote]['numCellsUsed'].append(numCellsUsed)\n+\n+ print 'received \"{0}\" at asn {1} from [{2}]:{3}, numCellsUsed={4}'.format(counter, asnBytes, hisAddress,hisPort,numCellsUsed)\n+\n+ # record data every 10 minutes\n+ if time.time()-previous_time>600:\n+ previous_time = time.time()\n+ with open('mote_counter_asn_cellusage.log','a') as f:\n+ f.write(str(mote_counter_asn_cellusage)+'\\n')\n+\n+ # stop listening udp packet when running for EXP_DURATION hours\n+ if (time.time()-network_start_time)>(3600*EXP_DURATION):\n+ break\n+\n+ # ==== record to file\n+\n+ with open('mote_counter_asn_cellusage.log','a') as f:\n+ f.write(str(mote_counter_asn_cellusage)+'\\n')\n+\n+# ==== generate list to plot\n+'''\n+target list:\n+ num_node_list,\n+ node_list_label,\n+ node_e2e_reliability,\n+ node_e2e_avg_latency,\n+ node_avg_cell_usage,\n+ node_avg_cell_usage_HIGH,\n+ node_avg_cell_usage_LOW\n+'''\n+\n+num_node_list = []\n+node_list_label = []\n+node_e2e_reliability = []\n+node_e2e_avg_latency = []\n+node_avg_cell_usage = []\n+node_avg_cell_usage_HIGH = []\n+node_avg_cell_usage_LOW = []\n+\n+num_node = 0\n+for mote,data in mote_counter_asn_cellusage.items():\n+\n+ num_node += 1\n+ num_node_list.append(num_node)\n+\n+ node_list_label.append(mote)\n+\n+ note_pdr = float(len(set(data['counter'])))/float(data['counter'][-1]-data['counter'][0]+1)\n+ node_e2e_reliability.append(note_pdr)\n+\n+ note_latency = sum(data['latency'])/len(data['latency'])\n+ node_e2e_avg_latency.append(note_latency)\n+\n+ note_cell_usage = float(sum(data['numCellsUsed'])/len(data['numCellsUsed']))\n+ note_cell_usage /= float(NUM_CELLS_ELAPSED)\n+ node_avg_cell_usage.append(note_cell_usage)\n+\n+ node_avg_cell_usage_HIGH.append(NUM_CELLS_USAGE_HIGH/float(NUM_CELLS_ELAPSED))\n+ node_avg_cell_usage_LOW.append(NUM_CELLS_USAGE_LOW/float(NUM_CELLS_ELAPSED))\n+\n+# ==== generate figures\n+\n+# pdr\n+fig, ax = plt.subplots()\n+ax.bar(num_node_list,node_e2e_reliability)\n+ax.set_xlabel('nodes')\n+ax.set_xticks(num_node_list)\n+ax.set_xticklabels(node_list_label, rotation=90)\n+ax.set_ylabel('end-to-end reliability')\n+plt.savefig('e2e_reliability.png')\n+plt.clf()\n+\n+# latency\n+fig, ax = plt.subplots()\n+ax.bar(num_node_list,node_e2e_avg_latency)\n+ax.set_xlabel('nodes')\n+ax.set_xticks(num_node_list)\n+ax.set_xticklabels(node_list_label, rotation=90)\n+ax.set_ylabel('end-to-end latency')\n+plt.savefig('e2e_latency.png')\n+plt.clf()\n- print 'received \"{0}\" at asn {1} from [{2}]:{3}'.format(counter, asn, hisAddress,hisPort)\n+# cell Usage\n+fig, ax = plt.subplots()\n+ax.plot(num_node_list,node_avg_cell_usage_HIGH,'r-')\n+plt.text(len(num_node_list)/2, 0.77, 'LIM_NUMCELLSUSED_HIGH', color='red')\n+ax.plot(num_node_list,node_avg_cell_usage_LOW,'r-')\n+plt.text(len(num_node_list)/2, 0.20, 'LIM_NUMCELLSUSED_LOW', color='red')\n+ax.plot(num_node_list,node_avg_cell_usage,'b-^')\n+ax.set_xlabel('nodes')\n+ax.set_xticks(num_node_list)\n+ax.set_xticklabels(node_list_label, rotation=90)\n+ax.set_ylabel('node cell usage')\n+ax.set_ylim([0,1])\n+plt.savefig('cell_usage.png')\n+plt.clf()\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
update cell usage figure
|
491,595 |
15.03.2019 11:28:55
| -3,600 |
25e2551843ba2f87c0c46ff4f9f7282c09d6c376
|
only remove packet not handled by component.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -142,7 +142,10 @@ void openqueue_removeAllCreatedBy(uint8_t creator) {\nINTERRUPT_DECLARATION();\nDISABLE_INTERRUPTS();\nfor (i=0;i<QUEUELENGTH;i++){\n- if (openqueue_vars.queue[i].creator==creator) {\n+ if (\n+ openqueue_vars.queue[i].creator == creator &&\n+ openqueue_vars.queue[i].owner != COMPONENT_IEEE802154E\n+ ) {\nopenqueue_reset_entry(&(openqueue_vars.queue[i]));\n}\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-725. only remove packet not handled by IEEE802154E component.
|
491,595 |
15.03.2019 12:05:46
| -3,600 |
f98ceaea47fa74a1ee925d8c0b65068bd0e15e54
|
update version number to develop version.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "static const uint8_t infoStackName[] = \"OpenWSN \";\n#define OPENWSN_VERSION_MAJOR 1\n-#define OPENWSN_VERSION_MINOR 24\n+#define OPENWSN_VERSION_MINOR 25\n#define OPENWSN_VERSION_PATCH 0\n#ifndef TRUE\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
update version number to develop version.
|
491,595 |
15.03.2019 14:57:15
| -3,600 |
f034cd3f710a7f65e7c131c5746d6a50f2a7aab2
|
record the network start time.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.py",
"new_path": "openapps/uinject/uinject.py",
"diff": "@@ -33,6 +33,9 @@ else:\nnetwork_start_time = time.time()\nprint \"Network starts at {0}\\n\".format(time.ctime(network_start_time))\n+ with open('network_start_time.txt','a') as f:\n+ f.write(str(network_start_time))\n+\n# open socket\nsocket_handler = socket.socket(socket.AF_INET6,socket.SOCK_DGRAM)\nsocket_handler.bind(('',61617))\n@@ -130,7 +133,7 @@ for mote,data in mote_counter_asn_cellusage.items():\n# pdr\nfig, ax = plt.subplots()\nax.bar(num_node_list,node_e2e_reliability)\n-ax.set_xlabel('nodes')\n+# ax.set_xlabel('nodes')\nax.set_xticks(num_node_list)\nax.set_xticklabels(node_list_label, rotation=90)\nax.set_ylabel('end-to-end reliability')\n@@ -140,7 +143,7 @@ plt.clf()\n# latency\nfig, ax = plt.subplots()\nax.bar(num_node_list,node_e2e_avg_latency)\n-ax.set_xlabel('nodes')\n+# ax.set_xlabel('nodes')\nax.set_xticks(num_node_list)\nax.set_xticklabels(node_list_label, rotation=90)\nax.set_ylabel('end-to-end latency')\n@@ -155,7 +158,7 @@ plt.text(len(num_node_list)/2, 0.77, 'LIM_NUMCELLSUSED_HIGH', color='red')\nax.plot(num_node_list,node_avg_cell_usage_LOW,'r-')\nplt.text(len(num_node_list)/2, 0.20, 'LIM_NUMCELLSUSED_LOW', color='red')\nax.plot(num_node_list,node_avg_cell_usage,'b-^')\n-ax.set_xlabel('nodes')\n+# ax.set_xlabel('nodes')\nax.set_xticks(num_node_list)\nax.set_xticklabels(node_list_label, rotation=90)\nax.set_ylabel('node cell usage')\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
record the network start time.
|
491,595 |
18.03.2019 09:40:24
| -3,600 |
c593a96defbeecf44e0885b924fd1b9709a0c573
|
record the original asn.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.py",
"new_path": "openapps/uinject/uinject.py",
"diff": "@@ -63,10 +63,14 @@ else:\nif mote not in mote_counter_asn_cellusage.keys():\nmote_counter_asn_cellusage[mote] = {}\nmote_counter_asn_cellusage[mote]['counter'] = []\n+ mote_counter_asn_cellusage[mote]['arriveTime'] = []\n+ mote_counter_asn_cellusage[mote]['asnBytes'] = []\nmote_counter_asn_cellusage[mote]['latency'] = []\nmote_counter_asn_cellusage[mote]['numCellsUsed'] = []\nmote_counter_asn_cellusage[mote]['counter'].append(counter)\n+ mote_counter_asn_cellusage[mote]['arriveTime'].append(time.time())\n+ mote_counter_asn_cellusage[mote]['asnBytes'].append(asnBytes)\nmote_counter_asn_cellusage[mote]['latency'].append(time.time()-asn*SLOTDURATION-network_start_time)\nmote_counter_asn_cellusage[mote]['numCellsUsed'].append(numCellsUsed)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
record the original asn.
|
491,595 |
18.03.2019 11:41:55
| -3,600 |
f8fb52959beeda73fe5ef3f524e6b1ad5d58cae9
|
add mote id in the payload.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.c",
"new_path": "openapps/uinject/uinject.c",
"diff": "@@ -155,6 +155,10 @@ void uinject_task_cb(void) {\nnumCellsUsed = msf_getPreviousNumCellsUsed();\npkt->payload[0] = numCellsUsed;\n+ packetfunctions_reserveHeaderSize(pkt,sizeof(uint16_t));\n+ pkt->payload[1] = (uint8_t)(idmanager_getMyID(ADDR_16B)->addr_16b[0]);\n+ pkt->payload[0] = (uint8_t)(idmanager_getMyID(ADDR_16B)->addr_16b[1]);\n+\nif ((openudp_send(pkt))==E_FAIL) {\nopenqueue_freePacketBuffer(pkt);\n} else {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
add mote id in the payload.
|
491,595 |
20.03.2019 11:59:25
| -3,600 |
054c990156ed5445bf05f24e167a0eeaf107b19d
|
check the buffer size when reading from FIFO for sub-Ghz.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.c",
"new_path": "bsp/chips/at86rf215/at86rf215.c",
"diff": "@@ -147,7 +147,7 @@ void at86rf215_spiWriteFifo(uint8_t* bufToWrite, uint16_t len, uint8_t type) {\n}\n-void at86rf215_spiReadRxFifo( uint8_t* pBufRead, uint16_t* lenRead, uint8_t type) {\n+void at86rf215_spiReadRxFifo( uint8_t* pBufRead, uint16_t* lenRead, uint8_t type, uint16_t maxBuffLength) {\nuint8_t spi_tx_buffer[4];\nuint8_t spi_rx_buffer[4];\n@@ -187,6 +187,7 @@ void at86rf215_spiReadRxFifo( uint8_t* pBufRead, uint16_t* lenRead, uint8_t type\nlength = (uint16_t)spi_rx_buffer[2] // RXFLL\n| ((uint16_t)(spi_rx_buffer[3] & 0x07) << 8); // RXFLH\n+ if (length<=maxBuffLength){\nspi_tx_buffer[0] = (FLAG_READ | (uint8_t)(register_bbc_fbrxs/256));\nspi_tx_buffer[1] = (uint8_t)(register_bbc_fbrxs%256);\n//read FIFO\n@@ -209,6 +210,7 @@ void at86rf215_spiReadRxFifo( uint8_t* pBufRead, uint16_t* lenRead, uint8_t type\nSPI_NOTFIRST, // isFirst\nSPI_LAST // isLast\n);\n+ }\n*(lenRead) = length;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.h",
"new_path": "bsp/chips/at86rf215/at86rf215.h",
"diff": "@@ -3981,7 +3981,7 @@ void at86rf215_spiWriteReg (uint16_t reg, uint8_t regValueToWrite);\nuint8_t at86rf215_spiReadReg (uint16_t regAddr16);\nvoid at86rf215_spiWriteFifo (uint8_t* bufToWrite, uint16_t len, uint8_t frequency_type);\n-void at86rf215_spiReadRxFifo (uint8_t* pBufRead, uint16_t* lenRead, uint8_t frequency_type);\n+void at86rf215_spiReadRxFifo (uint8_t* pBufRead, uint16_t* lenRead, uint8_t frequency_type, uint16_t maxBuffLength);\nuint8_t at86rf215_status (uint8_t frequency_type);\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -318,11 +318,15 @@ void radio_getReceivedFrame(\n}\n// read the received packet from the RXFIFO\n- at86rf215_spiReadRxFifo(bufRead, lenRead, ATMEL_FREQUENCY_TYPE);\n+ at86rf215_spiReadRxFifo(bufRead, lenRead, ATMEL_FREQUENCY_TYPE, maxBufLen);\n+ if (*lenRead>maxBufLen) {\n+ *crc = 0;\n+ } else {\n*rssi = at86rf215_spiReadReg(register_edv);\n*crc = (at86rf215_spiReadReg(register_bbc_pc)>>5);\n}\n+}\n//=========================== private =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -223,17 +223,22 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n}\n}\n+ if (app_vars.rxpk_crc==0){\n+ expectedFrame = FALSE;\n+ }\n+\n// read the packet number\napp_vars.rxpk_num = app_vars.rxpk_buf[0];\n// toggle led if the frame is expected\nif (expectedFrame){\n- // indicate I just received a packet from bsp_radio_tx mote\n- app_vars.rxpk_done = 1;\nleds_debug_toggle();\n}\n+ // indicate I just received a packet from bsp_radio_tx mote\n+ app_vars.rxpk_done = 1;\n+\n// keep listening (needed for at86rf215 radio)\nradio_rxEnable();\nradio_rxNow();\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"diff": "@@ -113,13 +113,14 @@ while True:\nwith open('log.txt','a') as f:\nf.write(output+'\\n')\n- if previousFrame>rxpk_num:\n+ if rxpk_crc ==1 and previousFrame>rxpk_num:\noutput = \"frameCounter={0:<3}, PDR={1}%\".format(frameCounter, frameCounter*100/MAX_NUM_PACKET)\nprint output\nframeCounter = 0\nwith open('log.txt','a') as f:\nf.write(output+'\\n')\n+ if rxpk_crc ==1:\nframeCounter += 1\npreviousFrame = rxpk_num\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-820. check the buffer size when reading from FIFO for sub-Ghz.
|
491,595 |
20.03.2019 12:14:32
| -3,600 |
66cb30cfb48608b58e707fda39b22fb49b53a03c
|
check the length is correct or not, don't change the crc.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -320,13 +320,9 @@ void radio_getReceivedFrame(\n// read the received packet from the RXFIFO\nat86rf215_spiReadRxFifo(bufRead, lenRead, ATMEL_FREQUENCY_TYPE, maxBufLen);\n- if (*lenRead>maxBufLen) {\n- *crc = 0;\n- } else {\n*rssi = at86rf215_spiReadReg(register_edv);\n*crc = (at86rf215_spiReadReg(register_bbc_pc)>>5);\n}\n-}\n//=========================== private =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -216,15 +216,16 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n// check the frame is sent by radio_tx project\nexpectedFrame = TRUE;\n+\n+ if (app_vars.rxpk_len>LENGTH_PACKET){\n+ expectedFrame = FALSE;\n+ } else {\nfor(i=1;i<10;i++){\nif(app_vars.rxpk_buf[i]!=i){\nexpectedFrame = FALSE;\nbreak;\n}\n}\n-\n- if (app_vars.rxpk_crc==0){\n- expectedFrame = FALSE;\n}\n// read the packet number\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"diff": "@@ -113,19 +113,18 @@ while True:\nwith open('log.txt','a') as f:\nf.write(output+'\\n')\n- if rxpk_crc ==1 and previousFrame>rxpk_num:\n+ if rxpk_len>127:\n+ print \"ERROR: frame too long.\\a\"\n+ else:\n+ if previousFrame>rxpk_num:\noutput = \"frameCounter={0:<3}, PDR={1}%\".format(frameCounter, frameCounter*100/MAX_NUM_PACKET)\nprint output\nframeCounter = 0\nwith open('log.txt','a') as f:\nf.write(output+'\\n')\n- if rxpk_crc ==1:\nframeCounter += 1\npreviousFrame = rxpk_num\n- if rxpk_len>127:\n- print \"ERROR: frame too long.\\a\"\n-\nrawFrame = []\nrawFrame_decoded = []\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-820. check the length is correct or not, don't change the crc.
|
491,595 |
20.03.2019 12:19:12
| -3,600 |
13906aeac3092175d6dcbc54570d49cbe781c8cd
|
set rxpk_done when it's expectedFrame.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -233,13 +233,12 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n// toggle led if the frame is expected\nif (expectedFrame){\n+ // indicate I just received a packet from bsp_radio_tx mote\n+ app_vars.rxpk_done = 1;\nleds_debug_toggle();\n}\n- // indicate I just received a packet from bsp_radio_tx mote\n- app_vars.rxpk_done = 1;\n-\n// keep listening (needed for at86rf215 radio)\nradio_rxEnable();\nradio_rxNow();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-820. set rxpk_done when it's expectedFrame.
|
491,595 |
21.03.2019 09:55:01
| -3,600 |
8c5b27ea2af52f5e44fa7a6f64afde47c8157ee9
|
don't select a parent larger than lowestRankInHistory+DAGMAXRANKINCREASE
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.h",
"new_path": "openstack/02b-MAChigh/neighbors.h",
"diff": "#define MAXDAGRANK 0xffff\n#define DEFAULTDAGRANK MAXDAGRANK\n#define MINHOPRANKINCREASE 256 // default value in RPL and Minimal 6TiSCH draft\n+#define DAGMAXRANKINCREASE 512 // per RFC6550 https://tools.ietf.org/html/rfc6550#section-8.2.2.4 point 3\n#define DEFAULTJOINPRIORITY 0xff\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -55,8 +55,10 @@ void icmpv6rpl_init(void) {\nicmpv6rpl_vars.daoSent=FALSE;\nif (idmanager_getIsDAGroot()==TRUE) {\nicmpv6rpl_vars.myDAGrank = MINHOPRANKINCREASE;\n+ icmpv6rpl_vars.lowestRankInHistory = MINHOPRANKINCREASE;\n} else {\nicmpv6rpl_vars.myDAGrank = DEFAULTDAGRANK;\n+ icmpv6rpl_vars.lowestRankInHistory = MAXDAGRANK;\n}\n//=== admin\n@@ -446,7 +448,16 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\nif (neighborRank==DEFAULTDAGRANK) continue;\n// compute tentative cost of full path to root through this neighbor\ntentativeDAGrank = (uint32_t)neighborRank+rankIncrease;\n- if (tentativeDAGrank > 65535) {tentativeDAGrank = 65535;}\n+ if (tentativeDAGrank > 65535) {\n+ tentativeDAGrank = 65535;\n+ }\n+ // if larger than lowestRank+maxRankIncrease, pass (per rfc6550#section-8.2.2.4)\n+ if (\n+ icmpv6rpl_vars.lowestRankInHistory<(MAXDAGRANK-DAGMAXRANKINCREASE) &&\n+ tentativeDAGrank>(icmpv6rpl_vars.lowestRankInHistory+DAGMAXRANKINCREASE)\n+ ) {\n+ continue;\n+ }\n// if not low enough to justify switch, pass (i.e. hysterisis)\nif (\n(previousDAGrank<tentativeDAGrank) ||\n@@ -458,6 +469,9 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\nfoundBetterParent=TRUE;\n// select best candidate so far\nif (icmpv6rpl_vars.myDAGrank>tentativeDAGrank) {\n+ if (tentativeDAGrank<icmpv6rpl_vars.lowestRankInHistory){\n+ icmpv6rpl_vars.lowestRankInHistory = (uint16_t)tentativeDAGrank;\n+ }\nicmpv6rpl_vars.myDAGrank = (uint16_t)tentativeDAGrank;\nicmpv6rpl_vars.ParentIndex = i;\nicmpv6rpl_vars.rankIncrease = rankIncrease;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.h",
"new_path": "openstack/03b-IPv6/icmpv6rpl.h",
"diff": "@@ -196,6 +196,7 @@ typedef struct {\nuint16_t daoPeriod; ///< dao period in seconds.\n// routing table\ndagrank_t myDAGrank; ///< rank of this router within DAG.\n+ dagrank_t lowestRankInHistory; ///< lowest Rank that the node has advertised\nuint16_t rankIncrease; ///< the cost of the link to the parent, in units of rank\nbool haveParent; ///< this router has a route to DAG root\nuint8_t ParentIndex; ///< index of Parent in neighbor table (iff haveParent==TRUE)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-821. don't select a parent larger than lowestRankInHistory+DAGMAXRANKINCREASE
|
491,595 |
21.03.2019 11:06:00
| -3,600 |
d70d77ff251acf85ef6fc23e9794c9d2e9f45518
|
slow down the traffic rate of DAO and uinject.
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.c",
"new_path": "openapps/uinject/uinject.c",
"diff": "#include \"schedule.h\"\n#include \"icmpv6rpl.h\"\n#include \"idmanager.h\"\n+#include \"openrandom.h\"\n#include \"msf.h\"\n+//=========================== defines =========================================\n+\n+#define UINJECT_TRAFFIC_RATE 2 ///> the value X indicates 1 packet/X minutes\n+\n//=========================== variables =======================================\nuinject_vars_t uinject_vars;\n@@ -77,8 +82,10 @@ void uinject_receive(OpenQueueEntry_t* pkt) {\nvoid uinject_timer_cb(opentimers_id_t id){\n// calling the task directly as the timer_cb function is executed in\n// task mode by opentimer already\n+ if(openrandom_get16b()<(0xffff/UINJECT_TRAFFIC_RATE)){\nuinject_task_cb();\n}\n+}\nvoid uinject_task_cb(void) {\nOpenQueueEntry_t* pkt;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "//=========================== definition ======================================\n#define DIO_PORTION 10\n-#define DAO_PORTION 30\n+#define DAO_PORTION 60\n//=========================== variables =======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
slow down the traffic rate of DAO and uinject.
|
491,595 |
21.03.2019 14:15:44
| -3,600 |
50586760237e34828ef7b1ba025945b0f6fff560
|
use 768 instead of 512 for DAGMAXRANKINCREASE.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.h",
"new_path": "openstack/02b-MAChigh/neighbors.h",
"diff": "#define MAXDAGRANK 0xffff\n#define DEFAULTDAGRANK MAXDAGRANK\n#define MINHOPRANKINCREASE 256 // default value in RPL and Minimal 6TiSCH draft\n-#define DAGMAXRANKINCREASE 512 // per RFC6550 https://tools.ietf.org/html/rfc6550#section-8.2.2.4 point 3\n+#define DAGMAXRANKINCREASE 768 // per RFC6550 https://tools.ietf.org/html/rfc6550#section-8.2.2.4 point 3\n#define DEFAULTJOINPRIORITY 0xff\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-821. use 768 instead of 512 for DAGMAXRANKINCREASE.
|
491,595 |
21.03.2019 17:30:48
| -3,600 |
f63b8f5af50623581b22a460cf6afbdc0d7b3260
|
unclear the blacklist.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -650,6 +650,9 @@ uint16_t neighbors_getLinkMetric(uint8_t index) {\n){\n// PDR too low, put the neighbor in blacklist\nneighbors_vars.neighbors[index].inBlacklist = TRUE;\n+ } else {\n+ // Remove the neighbor from blacklist\n+ neighbors_vars.neighbors[index].inBlacklist = FALSE;\n}\n}\nreturn rankIncrease;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-824. unclear the blacklist.
|
491,595 |
23.03.2019 15:31:39
| -3,600 |
0e37943acede2279154700d2bb4ea587fdb3ad73
|
cover the case when the autonomous unicast cell neighbor is not founded.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -999,10 +999,12 @@ port_INLINE void activity_ti1ORri1(void) {\n}\nif (ieee154e_vars.dataToSend == NULL) {\n- if (schedule_getAutonomousTxRxCellUnicastNeighbor(&autonomousUnicastNeighbor)==TRUE){\n+ schedule_getAutonomousTxRxCellUnicastNeighbor(&autonomousUnicastNeighbor);\n+\n+ // autonomousUnicastNeighbor may be not found\n+ // in that case any 6P request is OK to send on anycast autonomous cell\nieee154e_vars.dataToSend = openqueue_macGet6PRequestOnAnycast(&autonomousUnicastNeighbor);\n}\n- }\nif (ieee154e_vars.dataToSend == NULL) {\nieee154e_vars.dataToSend = openqueue_macGet6PResponseAndDownStreamPacket(&neighbor);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -302,10 +302,13 @@ OpenQueueEntry_t* openqueue_macGet6PRequestOnAnycast(open_addr_t* autonomousUnic\nopenqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\nopenqueue_vars.queue[i].creator==COMPONENT_SIXTOP_RES &&\n(\n+ (\n+ autonomousUnicastNeighbor == NULL ||\n(\nautonomousUnicastNeighbor->type==ADDR_64B &&\npacketfunctions_sameAddress(autonomousUnicastNeighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop) == FALSE\n)\n+ )\n) &&\nopenqueue_vars.queue[i].l2_sixtop_messageType == SIXTOP_CELL_REQUEST\n){\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-825. cover the case when the autonomous unicast cell neighbor is not founded.
|
491,595 |
23.03.2019 15:39:25
| -3,600 |
16baee2a8e11752f1ccce0c509ee21498b1a34cc
|
remove blacklist feature.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "@@ -384,7 +384,6 @@ typedef struct {\nasn_t asn;\nuint8_t joinPrio;\nbool f6PNORES;\n- bool inBlacklist;\nuint8_t sequenceNumber;\nuint8_t backoffExponenton;\nuint8_t backoff;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -165,10 +165,6 @@ bool neighbors_getNeighborNoResource(uint8_t index){\nreturn neighbors_vars.neighbors[index].f6PNORES;\n}\n-bool neighbors_getNeighborIsInBlacklist(uint8_t index){\n- return neighbors_vars.neighbors[index].inBlacklist;\n-}\n-\nuint8_t neighbors_getSequenceNumber(open_addr_t* address){\nuint8_t i;\nfor (i=0;i<MAXNUMNEIGHBORS;i++){\n@@ -643,17 +639,6 @@ uint16_t neighbors_getLinkMetric(uint8_t index) {\n} else {\nrankIncrease = (uint16_t)(rankIncreaseIntermediary >> 10);\n}\n-\n- if (\n- rankIncrease>(3*DEFAULTLINKCOST-2)*MINHOPRANKINCREASE &&\n- neighbors_vars.neighbors[index].numTx > MINIMAL_NUM_TX\n- ){\n- // PDR too low, put the neighbor in blacklist\n- neighbors_vars.neighbors[index].inBlacklist = TRUE;\n- } else {\n- // Remove the neighbor from blacklist\n- neighbors_vars.neighbors[index].inBlacklist = FALSE;\n- }\n}\nreturn rankIncrease;\n}\n@@ -684,13 +669,11 @@ void neighbors_removeOld(void) {\n/**\ndon't remove neighbor marked as:\n- 6P no resource\n- - in blacklist\n- pareferred parent\n*/\nif (\nneighbors_vars.neighbors[i].f6PNORES == FALSE &&\n- neighbors_vars.neighbors[i].inBlacklist == FALSE &&\nneighbors_vars.neighbors[i].parentPreference == 0\n){\nremoveNeighbor(i);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.h",
"new_path": "openstack/02b-MAChigh/neighbors.h",
"diff": "@@ -64,7 +64,6 @@ uint16_t neighbors_getLinkMetric(uint8_t index);\nopen_addr_t* neighbors_getKANeighbor(uint16_t kaPeriod);\nopen_addr_t* neighbors_getJoinProxy(void);\nbool neighbors_getNeighborNoResource(uint8_t index);\n-bool neighbors_getNeighborIsInBlacklist(uint8_t index);\nint8_t neighbors_getRssi(uint8_t index);\nuint8_t neighbors_getNumTx(uint8_t index);\nuint8_t neighbors_getSequenceNumber(open_addr_t* address);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -319,8 +319,7 @@ bool icmpv6rpl_getPreferredParentIndex(uint8_t* indexptr) {\nbool icmpv6rpl_getPreferredParentEui64(open_addr_t* addressToWrite) {\nif (\nicmpv6rpl_vars.haveParent &&\n- neighbors_getNeighborNoResource(icmpv6rpl_vars.ParentIndex) == FALSE &&\n- neighbors_getNeighborIsInBlacklist(icmpv6rpl_vars.ParentIndex) == FALSE\n+ neighbors_getNeighborNoResource(icmpv6rpl_vars.ParentIndex) == FALSE\n){\nreturn neighbors_getNeighborEui64(addressToWrite,ADDR_64B,icmpv6rpl_vars.ParentIndex);\n} else {\n@@ -407,8 +406,7 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\nif (icmpv6rpl_vars.haveParent==TRUE){\nif (\n- neighbors_getNeighborNoResource(icmpv6rpl_vars.ParentIndex) == TRUE ||\n- neighbors_getNeighborIsInBlacklist(icmpv6rpl_vars.ParentIndex) == TRUE\n+ neighbors_getNeighborNoResource(icmpv6rpl_vars.ParentIndex) == TRUE\n){\nicmpv6rpl_vars.myDAGrank = 65535;\n} else {\n@@ -435,8 +433,7 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\nif (neighbors_isStableNeighborByIndex(i)) { // in use and link is stable\n// neighbor marked as NORES can't be parent\nif (\n- neighbors_getNeighborNoResource(i) == TRUE ||\n- neighbors_getNeighborIsInBlacklist(i)== TRUE\n+ neighbors_getNeighborNoResource(i) == TRUE\n) {\ncontinue;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-826. remove blacklist feature.
|
491,595 |
23.03.2019 16:02:25
| -3,600 |
e9288c5078dc120998db84395948b3750b147033
|
initialize the autonomousUnicastNeighbor before using it.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -999,6 +999,7 @@ port_INLINE void activity_ti1ORri1(void) {\n}\nif (ieee154e_vars.dataToSend == NULL) {\n+ memset(&autonomousUnicastNeighborm, 0, sizeof(open_addr_t));\nschedule_getAutonomousTxRxCellUnicastNeighbor(&autonomousUnicastNeighbor);\n// autonomousUnicastNeighbor may be not found\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -303,7 +303,7 @@ OpenQueueEntry_t* openqueue_macGet6PRequestOnAnycast(open_addr_t* autonomousUnic\nopenqueue_vars.queue[i].creator==COMPONENT_SIXTOP_RES &&\n(\n(\n- autonomousUnicastNeighbor == NULL ||\n+ autonomousUnicastNeighbor->type==ADDR_NONE ||\n(\nautonomousUnicastNeighbor->type==ADDR_64B &&\npacketfunctions_sameAddress(autonomousUnicastNeighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop) == FALSE\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-825. initialize the autonomousUnicastNeighbor before using it.
|
491,595 |
23.03.2019 16:28:59
| -3,600 |
a114d46fdf74552895b59e064bfae839feb5cfe6
|
using bar rather than lines for cell usage of each node
|
[
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.py",
"new_path": "openapps/uinject/uinject.py",
"diff": "@@ -161,7 +161,7 @@ ax.plot(num_node_list,node_avg_cell_usage_HIGH,'r-')\nplt.text(len(num_node_list)/2, 0.77, 'LIM_NUMCELLSUSED_HIGH', color='red')\nax.plot(num_node_list,node_avg_cell_usage_LOW,'r-')\nplt.text(len(num_node_list)/2, 0.20, 'LIM_NUMCELLSUSED_LOW', color='red')\n-ax.plot(num_node_list,node_avg_cell_usage,'b-^')\n+ax.bar(num_node_list,node_avg_cell_usage)\n# ax.set_xlabel('nodes')\nax.set_xticks(num_node_list)\nax.set_xticklabels(node_list_label, rotation=90)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
using bar rather than lines for cell usage of each node
|
491,595 |
23.03.2019 18:22:04
| -3,600 |
4ad5c901984504e1761bf57cb1aca849b6011645
|
record the application packets when it's dropped.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "@@ -153,23 +153,24 @@ enum {\n//TRAN\nCOMPONENT_OPENUDP = 0x17,\nCOMPONENT_OPENCOAP = 0x18,\n+ // secure join\n+ COMPONENT_CJOIN = 0x19,\n+ COMPONENT_OPENOSCOAP = 0x1a,\n// applications\n- COMPONENT_C6T = 0x19,\n- COMPONENT_CEXAMPLE = 0x1a,\n- COMPONENT_CINFO = 0x1b,\n- COMPONENT_CLEDS = 0x1c,\n- COMPONENT_CSENSORS = 0x1d,\n- COMPONENT_CSTORM = 0x1e,\n- COMPONENT_CWELLKNOWN = 0x1f,\n- COMPONENT_UECHO = 0x20,\n- COMPONENT_UINJECT = 0x21,\n- COMPONENT_RRT = 0x22,\n- COMPONENT_SECURITY = 0x23,\n- COMPONENT_USERIALBRIDGE = 0x24,\n- COMPONENT_UEXPIRATION = 0x25,\n- COMPONENT_UMONITOR = 0x26,\n- COMPONENT_CJOIN = 0x27,\n- COMPONENT_OPENOSCOAP = 0x28,\n+ COMPONENT_C6T = 0x1b,\n+ COMPONENT_CEXAMPLE = 0x1c,\n+ COMPONENT_CINFO = 0x1d,\n+ COMPONENT_CLEDS = 0x1e,\n+ COMPONENT_CSENSORS = 0x1f,\n+ COMPONENT_CSTORM = 0x20,\n+ COMPONENT_CWELLKNOWN = 0x21,\n+ COMPONENT_UECHO = 0x22,\n+ COMPONENT_UINJECT = 0x23,\n+ COMPONENT_RRT = 0x24,\n+ COMPONENT_SECURITY = 0x25,\n+ COMPONENT_USERIALBRIDGE = 0x26,\n+ COMPONENT_UEXPIRATION = 0x27,\n+ COMPONENT_UMONITOR = 0x28,\nCOMPONENT_CINFRARED = 0x29,\n};\n@@ -189,80 +190,80 @@ enum {\nERR_COMMAND_NOT_ALLOWED = 0x05, // the command is not allowed, command = {0}\n// l4\nERR_WRONG_TRAN_PROTOCOL = 0x06, // unknown transport protocol {0} (code location {1})\n- ERR_WRONG_TCP_STATE = 0x07, // wrong TCP state {0} (code location {1})\n- ERR_TCP_RESET = 0x08, // TCP reset while in state {0} (code location {1})\n- ERR_UNSUPPORTED_PORT_NUMBER = 0x09, // unsupported port number {0} (code location {1})\n+ ERR_UNSUPPORTED_PORT_NUMBER = 0x07, // unsupported port number {0} (code location {1})\n// l3\n- ERR_UNEXPECTED_DAO = 0x0a, // unexpected DAO (code location {0}). A change maybe happened on dagroot node.\n- ERR_UNSUPPORTED_ICMPV6_TYPE = 0x0b, // unsupported ICMPv6 type {0} (code location {1})\n- ERR_6LOWPAN_UNSUPPORTED = 0x0c, // unsupported 6LoWPAN parameter {1} at location {0}\n- ERR_NO_NEXTHOP = 0x0d, // no next hop for layer 3 destination {0:x}{1:x}\n- ERR_INVALID_PARAM = 0x0e, // invalid parameter\n- ERR_INVALID_FWDMODE = 0x0f, // invalid forward mode\n- ERR_LARGE_DAGRANK = 0x10, // large DAGrank {0}, set to {1}\n- ERR_HOP_LIMIT_REACHED = 0x11, // packet discarded hop limit reached\n- ERR_LOOP_DETECTED = 0x12, // loop detected due to previous rank {0} lower than current node rank {1}\n- ERR_WRONG_DIRECTION = 0x13, // upstream packet set to be downstream, possible loop.\n- ERR_FORWARDING_PACKET_DROPPED = 0x14, // packet received from mote {0:x}{1:x} is dropped\n+ ERR_UNEXPECTED_DAO = 0x08, // unexpected DAO (code location {0}). A change maybe happened on dagroot node.\n+ ERR_UNSUPPORTED_ICMPV6_TYPE = 0x09, // unsupported ICMPv6 type {0} (code location {1})\n+ ERR_6LOWPAN_UNSUPPORTED = 0x0a, // unsupported 6LoWPAN parameter {1} at location {0}\n+ ERR_NO_NEXTHOP = 0x0b, // no next hop for layer 3 destination {0:x}{1:x}\n+ ERR_INVALID_PARAM = 0x0c, // invalid parameter\n+ ERR_INVALID_FWDMODE = 0x0d, // invalid forward mode\n+ ERR_LARGE_DAGRANK = 0x0e, // large DAGrank {0}, set to {1}\n+ ERR_HOP_LIMIT_REACHED = 0x0f, // packet discarded hop limit reached\n+ ERR_LOOP_DETECTED = 0x10, // loop detected due to previous rank {0} lower than current node rank {1}\n+ ERR_WRONG_DIRECTION = 0x11, // upstream packet set to be downstream, possible loop.\n+ ERR_FORWARDING_PACKET_DROPPED = 0x12, // packet to forward is dropped (code location {0})\n// l2b\n- ERR_NEIGHBORS_FULL = 0x15, // neighbors table is full (max number of neighbor is {0})\n- ERR_NO_SENT_PACKET = 0x16, // there is no sent packet in queue\n- ERR_NO_RECEIVED_PACKET = 0x17, // there is no received packet in queue\n- ERR_SCHEDULE_OVERFLOWN = 0x18, // schedule overflown\n+ ERR_NEIGHBORS_FULL = 0x13, // neighbors table is full (max number of neighbor is {0})\n+ ERR_NO_SENT_PACKET = 0x14, // there is no sent packet in queue\n+ ERR_NO_RECEIVED_PACKET = 0x15, // there is no received packet in queue\n+ ERR_SCHEDULE_OVERFLOWN = 0x16, // schedule overflown\n// l2a\n- ERR_WRONG_CELLTYPE = 0x19, // wrong celltype {0} at slotOffset {1}\n- ERR_IEEE154_UNSUPPORTED = 0x1a, // unsupported IEEE802.15.4 parameter {1} at location {0}\n- ERR_DESYNCHRONIZED = 0x1b, // got desynchronized at slotOffset {0}\n- ERR_SYNCHRONIZED = 0x1c, // synchronized at slotOffset {0}\n- ERR_LARGE_TIMECORRECTION = 0x1d, // large timeCorr.: {0} ticks (code loc. {1})\n- ERR_WRONG_STATE_IN_ENDFRAME_SYNC = 0x1e, // wrong state {0} in end of frame+sync\n- ERR_WRONG_STATE_IN_STARTSLOT = 0x1f, // wrong state {0} in startSlot, at slotOffset {1}\n- ERR_WRONG_STATE_IN_TIMERFIRES = 0x20, // wrong state {0} in timer fires, at slotOffset {1}\n- ERR_WRONG_STATE_IN_NEWSLOT = 0x21, // wrong state {0} in start of frame, at slotOffset {1}\n- ERR_WRONG_STATE_IN_ENDOFFRAME = 0x22, // wrong state {0} in end of frame, at slotOffset {1}\n- ERR_MAXTXDATAPREPARE_OVERFLOW = 0x23, // maxTxDataPrepare overflows while at state {0} in slotOffset {1}\n- ERR_MAXRXACKPREPARE_OVERFLOWS = 0x24, // maxRxAckPrepapare overflows while at state {0} in slotOffset {1}\n- ERR_MAXRXDATAPREPARE_OVERFLOWS = 0x25, // maxRxDataPrepapre overflows while at state {0} in slotOffset {1}\n- ERR_MAXTXACKPREPARE_OVERFLOWS = 0x26, // maxTxAckPrepapre overflows while at state {0} in slotOffset {1}\n- ERR_WDDATADURATION_OVERFLOWS = 0x27, // wdDataDuration overflows while at state {0} in slotOffset {1}\n- ERR_WDRADIO_OVERFLOWS = 0x28, // wdRadio overflows while at state {0} in slotOffset {1}\n- ERR_WDRADIOTX_OVERFLOWS = 0x29, // wdRadioTx overflows while at state {0} in slotOffset {1}\n- ERR_WDACKDURATION_OVERFLOWS = 0x2a, // wdAckDuration overflows while at state {0} in slotOffset {1}\n+ ERR_WRONG_CELLTYPE = 0x17, // wrong celltype {0} at slotOffset {1}\n+ ERR_IEEE154_UNSUPPORTED = 0x18, // unsupported IEEE802.15.4 parameter {1} at location {0}\n+ ERR_DESYNCHRONIZED = 0x19, // got desynchronized at slotOffset {0}\n+ ERR_SYNCHRONIZED = 0x1a, // synchronized at slotOffset {0}\n+ ERR_LARGE_TIMECORRECTION = 0x1b, // large timeCorr.: {0} ticks (code loc. {1})\n+ ERR_WRONG_STATE_IN_ENDFRAME_SYNC = 0x1c, // wrong state {0} in end of frame+sync\n+ ERR_WRONG_STATE_IN_STARTSLOT = 0x1d, // wrong state {0} in startSlot, at slotOffset {1}\n+ ERR_WRONG_STATE_IN_TIMERFIRES = 0x1e, // wrong state {0} in timer fires, at slotOffset {1}\n+ ERR_WRONG_STATE_IN_NEWSLOT = 0x1f, // wrong state {0} in start of frame, at slotOffset {1}\n+ ERR_WRONG_STATE_IN_ENDOFFRAME = 0x20, // wrong state {0} in end of frame, at slotOffset {1}\n+ ERR_MAXTXDATAPREPARE_OVERFLOW = 0x21, // maxTxDataPrepare overflows while at state {0} in slotOffset {1}\n+ ERR_MAXRXACKPREPARE_OVERFLOWS = 0x22, // maxRxAckPrepapare overflows while at state {0} in slotOffset {1}\n+ ERR_MAXRXDATAPREPARE_OVERFLOWS = 0x23, // maxRxDataPrepapre overflows while at state {0} in slotOffset {1}\n+ ERR_MAXTXACKPREPARE_OVERFLOWS = 0x24, // maxTxAckPrepapre overflows while at state {0} in slotOffset {1}\n+ ERR_WDDATADURATION_OVERFLOWS = 0x25, // wdDataDuration overflows while at state {0} in slotOffset {1}\n+ ERR_WDRADIO_OVERFLOWS = 0x26, // wdRadio overflows while at state {0} in slotOffset {1}\n+ ERR_WDRADIOTX_OVERFLOWS = 0x27, // wdRadioTx overflows while at state {0} in slotOffset {1}\n+ ERR_WDACKDURATION_OVERFLOWS = 0x28, // wdAckDuration overflows while at state {0} in slotOffset {1}\n// general\n- ERR_BUSY_SENDING = 0x2b, // busy sending\n- ERR_UNEXPECTED_SENDDONE = 0x2c, // sendDone for packet I didn't send\n- ERR_NO_FREE_PACKET_BUFFER = 0x2d, // no free packet buffer (code location {0})\n- ERR_FREEING_UNUSED = 0x2e, // freeing unused memory\n- ERR_FREEING_ERROR = 0x2f, // freeing memory unsupported memory\n- ERR_UNSUPPORTED_COMMAND = 0x30, // unsupported command {0}\n- ERR_MSG_UNKNOWN_TYPE = 0x31, // unknown message type {0}\n- ERR_WRONG_ADDR_TYPE = 0x32, // wrong address type {0} (code location {1})\n- ERR_BRIDGE_MISMATCH = 0x33, // bridge mismatch (code location {0})\n- ERR_HEADER_TOO_LONG = 0x34, // header too long, length {1} (code location {0})\n- ERR_INPUTBUFFER_LENGTH = 0x35, // input length problem, length={0}\n- ERR_BOOTED = 0x36, // booted\n- ERR_INVALIDSERIALFRAME = 0x37, // invalid serial frame\n- ERR_INVALIDPACKETFROMRADIO = 0x38, // invalid packet frome radio, length {1} (code location {0})\n- ERR_BUSY_RECEIVING = 0x39, // busy receiving when stop of serial activity, buffer input length {1} (code location {0})\n- ERR_WRONG_CRC_INPUT = 0x3a, // wrong CRC in input Buffer\n- ERR_PACKET_SYNC = 0x3b, // synchronized when received a packet\n- ERR_SECURITY = 0x3c, // security error on frameType {0}, code location {1}\n- ERR_SIXTOP_RETURNCODE = 0x3d, // sixtop return code {0} at sixtop state {1}\n- ERR_SIXTOP_COUNT = 0x3e, // there are {0} cells to request mote\n- ERR_SIXTOP_LIST = 0x3f, // the cells reserved to request mote contains slot {0} and slot {1}\n- ERR_SCHEDULE_ADDDUPLICATESLOT = 0x40, // the slot {0} to be added is already in schedule\n- ERR_UNSUPPORTED_FORMAT = 0x41, // the received packet format is not supported (code location {0})\n- ERR_UNSUPPORTED_METADATA = 0x42, // the metadata type is not suppored\n- //l3\n- ERR_6LORH_DEADLINE_EXPIRED = 0x43, // the received packet has expired\n- ERR_6LORH_DEADLINE_DROPPED = 0x44, // packet expiry time reached, dropped\n+ ERR_BUSY_SENDING = 0x29, // busy sending\n+ ERR_UNEXPECTED_SENDDONE = 0x2a, // sendDone for packet I didn't send\n+ ERR_NO_FREE_PACKET_BUFFER = 0x2b, // no free packet buffer (code location {0})\n+ ERR_FREEING_UNUSED = 0x2c, // freeing unused memory\n+ ERR_FREEING_ERROR = 0x2d, // freeing memory unsupported memory\n+ ERR_UNSUPPORTED_COMMAND = 0x2e, // unsupported command {0}\n+ ERR_MSG_UNKNOWN_TYPE = 0x2f, // unknown message type {0}\n+ ERR_WRONG_ADDR_TYPE = 0x30, // wrong address type {0} (code location {1})\n+ ERR_BRIDGE_MISMATCH = 0x31, // bridge mismatch (code location {0})\n+ ERR_HEADER_TOO_LONG = 0x32, // header too long, length {1} (code location {0})\n+ ERR_INPUTBUFFER_LENGTH = 0x33, // input length problem, length={0}\n+ ERR_BOOTED = 0x34, // booted\n+ ERR_INVALIDSERIALFRAME = 0x35, // invalid serial frame\n+ ERR_INVALIDPACKETFROMRADIO = 0x36, // invalid packet frome radio, length {1} (code location {0})\n+ ERR_BUSY_RECEIVING = 0x37, // busy receiving when stop of serial activity, buffer input length {1} (code location {0})\n+ ERR_WRONG_CRC_INPUT = 0x38, // wrong CRC in input Buffer\n+ ERR_PACKET_SYNC = 0x39, // synchronized when received a packet\n+ ERR_SECURITY = 0x3a, // security error on frameType {0}, code location {1}\n+ ERR_SIXTOP_RETURNCODE = 0x3b, // sixtop return code {0} at sixtop state {1}\n+ ERR_SIXTOP_COUNT = 0x3c, // there are {0} cells to request mote\n+ ERR_SIXTOP_LIST = 0x3d, // the cells reserved to request mote contains slot {0} and slot {1}\n+ ERR_SCHEDULE_ADDDUPLICATESLOT = 0x3e, // the slot {0} to be added is already in schedule\n+ ERR_UNSUPPORTED_FORMAT = 0x3f, // the received packet format is not supported (code location {0})\n+ ERR_UNSUPPORTED_METADATA = 0x40, // the metadata type is not suppored\n+ // deadline option\n+ ERR_6LORH_DEADLINE_EXPIRED = 0x41, // the received packet has expired\n+ ERR_6LORH_DEADLINE_DROPPED = 0x42, // packet expiry time reached, dropped\n// join and OSCOAP\n- ERR_JOINED = 0x45, // node joined\n- ERR_SEQUENCE_NUMBER_OVERFLOW = 0x46, // OSCOAP sequence number reached maximum value\n- ERR_BUFFER_OVERFLOW = 0x47, // OSCOAP buffer overflow detected (code location {0})\n- ERR_REPLAY_FAILED = 0x48, // OSCOAP replay protection failed\n- ERR_DECRYPTION_FAILED = 0x49, // OSCOAP decryption and tag verification failed\n- ERR_ABORT_JOIN_PROCESS = 0x4a, // Aborted join process (code location {0})\n+ ERR_JOINED = 0x43, // node joined\n+ ERR_SEQUENCE_NUMBER_OVERFLOW = 0x44, // OSCOAP sequence number reached maximum value\n+ ERR_BUFFER_OVERFLOW = 0x45, // OSCOAP buffer overflow detected (code location {0})\n+ ERR_REPLAY_FAILED = 0x46, // OSCOAP replay protection failed\n+ ERR_DECRYPTION_FAILED = 0x47, // OSCOAP decryption and tag verification failed\n+ ERR_ABORT_JOIN_PROCESS = 0x48, // Aborted join process (code location {0})\n+ // uinject\n+ ERR_UINJECT_PACKET_DROPPED = 0x49, // uinject packet (counter: {0}) is dropped\n};\n//=========================== typedef =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/uinject/uinject.c",
"new_path": "openapps/uinject/uinject.c",
"diff": "@@ -51,6 +51,15 @@ void uinject_init(void) {\nvoid uinject_sendDone(OpenQueueEntry_t* msg, owerror_t error) {\n+ if (error==E_FAIL){\n+ openserial_printError(\n+ COMPONENT_UINJECT,\n+ ERR_UINJECT_PACKET_DROPPED,\n+ (errorparameter_t)uinject_vars.counter,\n+ (errorparameter_t)0\n+ );\n+ }\n+\n// free the packet buffer entry\nopenqueue_freePacketBuffer(msg);\n@@ -61,13 +70,6 @@ void uinject_sendDone(OpenQueueEntry_t* msg, owerror_t error) {\nvoid uinject_receive(OpenQueueEntry_t* pkt) {\nopenqueue_freePacketBuffer(pkt);\n-\n- openserial_printError(\n- COMPONENT_UINJECT,\n- ERR_RCVD_ECHO_REPLY,\n- (errorparameter_t)0,\n- (errorparameter_t)0\n- );\n}\n//=========================== private =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/forwarding.c",
"new_path": "openstack/03b-IPv6/forwarding.c",
"diff": "@@ -234,6 +234,15 @@ void forwarding_sendDone(OpenQueueEntry_t* msg, owerror_t error) {\nif (msg->creator==COMPONENT_RADIO || msg->creator==COMPONENT_FORWARDING) {\n// this is a relayed packet\n+ if (error==E_FAIL) {\n+ openserial_printError(\n+ COMPONENT_FORWARDING,\n+ ERR_FORWARDING_PACKET_DROPPED,\n+ (errorparameter_t)1,\n+ (errorparameter_t)0\n+ );\n+ }\n+\n// free packet\nopenqueue_freePacketBuffer(msg);\n} else {\n@@ -248,7 +257,6 @@ void forwarding_sendDone(OpenQueueEntry_t* msg, owerror_t error) {\nicmpv6_sendDone(msg,error);\nbreak;\ndefault:\n-\n// log error\nopenserial_printCritical(\nCOMPONENT_FORWARDING,\n@@ -359,8 +367,8 @@ void forwarding_receive(\nopenserial_printError(\nCOMPONENT_FORWARDING,\nERR_FORWARDING_PACKET_DROPPED,\n- (errorparameter_t)msg->l2_nextORpreviousHop.addr_64b[6],\n- (errorparameter_t)msg->l2_nextORpreviousHop.addr_64b[7]\n+ (errorparameter_t)0,\n+ (errorparameter_t)0\n);\nopenqueue_freePacketBuffer(msg);\nreturn;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-822. record the application packets when it's dropped.
|
491,595 |
23.03.2019 20:47:55
| -3,600 |
b540f5666c58616ba79013eaa2656f24c4e101df
|
increase number of tries to 15.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -38,7 +38,7 @@ static const uint8_t ebIEsBytestream[] = {\n#define EB_IE_LEN 28\n#define NUM_CHANNELS 16 // number of channels to channel hop on\n-#define TXRETRIES 3 // number of MAC retries before declaring failed\n+#define TXRETRIES 15 // number of MAC retries before declaring failed\n#define TX_POWER 31 // 1=-25dBm, 31=0dBm (max value)\n#define RESYNCHRONIZATIONGUARD 5 // in 32kHz ticks. min distance to the end of the slot to successfully synchronize\n#define US_PER_TICK 30 // number of us per 32kHz clock tick\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-827. increase number of tries to 15.
|
491,595 |
26.03.2019 20:00:37
| -3,600 |
e45f0ae89af304be011ffef357af09cd7b20f8d1
|
relocate cell when link quality is lower than threshold.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -573,40 +573,19 @@ bool schedule_isNumTxWrapped(open_addr_t* neighbor){\nbool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist){\nuint8_t i;\n- uint16_t highestPDR;\nuint16_t cellPDR;\nINTERRUPT_DECLARATION();\nDISABLE_INTERRUPTS();\n- highestPDR = 0;\n// found the cell with higest PDR\nfor(i=0;i<MAXACTIVESLOTS;i++) {\nif(\npacketfunctions_sameAddress(&schedule_vars.scheduleBuf[i].neighbor, neighbor) == TRUE\n){\n- if (schedule_vars.scheduleBuf[i].numTx>0){\n+ if (schedule_vars.scheduleBuf[i].numTx>MINIMAL_NUM_TX){\ncellPDR = 100*schedule_vars.scheduleBuf[i].numTxACK/schedule_vars.scheduleBuf[i].numTx;\n- if (cellPDR > highestPDR){\n- highestPDR = cellPDR;\n- }\n- }\n- }\n- }\n-\n- if (highestPDR==0){\n- // no cell to relocate\n- ENABLE_INTERRUPTS();\n- return FALSE;\n- }\n-\n- for(i=0;i<MAXACTIVESLOTS;i++) {\n- if(\n- packetfunctions_sameAddress(&schedule_vars.scheduleBuf[i].neighbor, neighbor) == TRUE\n- ){\n- if (schedule_vars.scheduleBuf[i].numTx>0){\n- cellPDR = 100*schedule_vars.scheduleBuf[i].numTxACK/schedule_vars.scheduleBuf[i].numTx;\n- if (highestPDR-cellPDR > RELOCATE_PDRTHRES){\n+ if (cellPDR < RELOCATE_PDRTHRES){\ncelllist->isUsed = TRUE;\ncelllist->slotoffset = schedule_vars.scheduleBuf[i].slotOffset;\ncelllist->channeloffset = schedule_vars.scheduleBuf[i].channelOffset;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -70,7 +70,7 @@ See MINBE for an explanation of backoff.\n/**\n\\brief a threshold used for triggering the maintaining process.uint: percent\n*/\n-#define RELOCATE_PDRTHRES 50 // 50 means 50%\n+#define RELOCATE_PDRTHRES 30 // 50 means 50%\ntypedef enum{\nCELLOPTIONS_TX = 1<<0,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-828. relocate cell when link quality is lower than threshold.
|
491,595 |
26.03.2019 20:03:18
| -3,600 |
2d4a5069c4c9f79181048d8f87f23656d782241a
|
reset the lowest rank when myRank reach to MAXDAGRANK.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -515,6 +515,11 @@ void icmpv6rpl_updateMyDAGrankAndParentSelection(void) {\nicmpv6rpl_vars.rankIncrease= prevRankIncrease;\n// no change to report on\n}\n+\n+ // if my rank is reached to MAXDAGRANK\n+ if (icmpv6rpl_vars.myDAGrank==MAXDAGRANK) {\n+ icmpv6rpl_vars.lowestRankInHistory = MAXDAGRANK;\n+ }\n}\n/**\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-821. reset the lowest rank when myRank reach to MAXDAGRANK.
|
491,595 |
26.03.2019 20:17:22
| -3,600 |
ad6e80199e21e3d0cf7398e644c94545e846e46a
|
disable the travis for msp430 based board.
|
[
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -14,13 +14,13 @@ before_script:\nscript:\n- mkdir -p ./build/doc/\n- scons docs\n-- scons board=telosb toolchain=mspgcc verbose=1 oos_macpong\n-- scons board=telosb kernel=freertos toolchain=mspgcc verbose=1 oos_macpong\n+# - scons board=telosb toolchain=mspgcc verbose=1 oos_macpong\n+# - scons board=telosb kernel=freertos toolchain=mspgcc verbose=1 oos_macpong\n- scons board=openmote-cc2538 toolchain=armgcc verbose=1 oos_macpong\n-- scons board=wsn430v14 toolchain=mspgcc verbose=1 oos_macpong\n-- scons board=wsn430v13b toolchain=mspgcc verbose=1 oos_macpong\n-- scons board=gina toolchain=mspgcc verbose=1 oos_macpong\n-- scons board=z1 toolchain=mspgcc verbose=1 oos_macpong\n+# - scons board=wsn430v14 toolchain=mspgcc verbose=1 oos_macpong\n+# - scons board=wsn430v13b toolchain=mspgcc verbose=1 oos_macpong\n+# - scons board=gina toolchain=mspgcc verbose=1 oos_macpong\n+# - scons board=z1 toolchain=mspgcc verbose=1 oos_macpong\n- scons board=iot-lab_M3 toolchain=armgcc verbose=1 oos_macpong\n- scons board=iot-lab_A8-M3 toolchain=armgcc verbose=1 oos_macpong\n# - scons board=telosb toolchain=mspgcc verbose=1 oos_openwsn\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
disable the travis for msp430 based board.
|
491,595 |
09.04.2019 10:28:00
| 25,200 |
764be2d1f303405962c429fa83e130b23ce21ddb
|
add bootload_script and bit file.
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/scum/SCM3B_bootload_script.py",
"diff": "+import serial\n+import random\n+import time\n+\n+# SCM-3B Bootload Script\n+# BW 11/17/18\n+\n+# Set COM port and binary file path below\n+# Supports both optical and wired bootload modes, set flags accordingly\n+\n+# Parameters\n+# ---------------------------------------------------------------------\n+com_port = 'COM11';\n+\n+binFilePath = \"{0}\\Objects\\{0}.bin\".format('01bsp_leds')\n+\n+# 1 = use optical program mode\n+# 0 = use wired 3-wire bus mode\n+boot_mode = 1;\n+\n+# 1 = do not perform hard reset before optical programming\n+# 0 = perform hard reset before optical programming\n+skip_reset = 0;\n+\n+# 1 = insert CRC for payload integrity checking\n+# 0 = do not insert CRC\n+# SCM C code must also be set up for CRC check for this to work\n+insert_CRC = 1;\n+\n+# 1 = pad unused payload space with random data and check it with CRC\n+# 0 = pad with zeros, do not check integrity of padding\n+# This is useful to check for programming errors over full 64kB payload\n+pad_random_payload = 0;\n+# ---------------------------------------------------------------------\n+\n+# Open COM port to teensy optical programmer\n+ser = serial.Serial(\n+ port=com_port,\n+ baudrate=1000000,\n+ parity=serial.PARITY_NONE,\n+ stopbits=serial.STOPBITS_ONE,\n+ bytesize=serial.EIGHTBITS\n+)\n+\n+# Read binary file from Keil\n+with open(binFilePath, 'rb') as f:\n+ bindata = bytearray(f.read())\n+\n+# Need to know how long the binary payload is for computing CRC\n+code_length = len(bindata) - 1\n+pad_length = 65536 - code_length - 1\n+\n+# Optional: pad out payload with random data if desired\n+# Otherwise pad out with zeros - uC must receive full 64kB\n+if(pad_random_payload == 1):\n+ for i in xrange(pad_length):\n+ bindata.append(random.randint(0,255))\n+ code_length = len(bindata) - 1 - 8\n+else:\n+ for i in xrange(pad_length):\n+ bindata.append(0)\n+\n+if(insert_CRC == 1):\n+ # Insert code length at address 0x0000FFF8 for CRC calculation\n+ # Teensy will use this length value for calculating CRC\n+ bindata[65528] = code_length % 256\n+ bindata[65529] = code_length // 256\n+ bindata[65530] = 0\n+ bindata[65531] = 0\n+\n+# Transfer payload to Teensy\n+ser.write('transfersram\\n')\n+print ser.readline()\n+# Send the binary data over uart\n+ser.write(bindata)\n+\n+if(insert_CRC == 1):\n+ # Have Teensy calculate 32-bit CRC over the code length\n+ # It will store the 32-bit result at address 0x0000FFFC\n+ ser.write('insertcrc\\n')\n+\n+if(boot_mode == 1):\n+ # Configure parameters for optical TX\n+ ser.write('configopt\\n')\n+ ser.write('80\\n')\n+ ser.write('80\\n')\n+ ser.write('3\\n')\n+ ser.write('80\\n')\n+\n+ # Encode the payload into 4B5B for optical transmission\n+ ser.write('encode4b5b\\n')\n+\n+ if(skip_reset == 0):\n+ # Do a hard reset and then optically boot\n+ ser.write('bootopt4b5b\\n')\n+\n+ else:\n+ # Skip the hard reset before booting\n+ ser.write('bootopt4b5bnorst\\n')\n+\n+\n+ # Display confirmation message from Teensy\n+ print ser.readline()\n+\n+else:\n+\n+ # Execute 3-wire bus bootloader on Teensy\n+ ser.write('boot3wb\\n')\n+\n+ # Display confirmation message from Teensy\n+ print ser.readline()\n+\n+time.sleep(2)\n+# Do optical calibration\n+ser.write('opti_cal\\n')\n+\n+\n+ser.close()\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": "projects/scum/SCM3C_FPGA_scm3c_branch_v3.bit",
"new_path": "projects/scum/SCM3C_FPGA_scm3c_branch_v3.bit",
"diff": "Binary files /dev/null and b/projects/scum/SCM3C_FPGA_scm3c_branch_v3.bit differ\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. add bootload_script and bit file.
|
491,595 |
09.04.2019 14:35:22
| 25,200 |
a2195710eefc1d5498df2a829759bdbe2eb54217
|
don't insert crc (to be debug why crc failed) and print the bin file path.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/scum/SCM3B_bootload_script.py",
"new_path": "projects/scum/SCM3B_bootload_script.py",
"diff": "@@ -14,6 +14,9 @@ com_port = 'COM11';\nbinFilePath = \"{0}\\Objects\\{0}.bin\".format('01bsp_leds')\n+\n+print \"bin file path: {0}\".format(binFilePath)\n+\n# 1 = use optical program mode\n# 0 = use wired 3-wire bus mode\nboot_mode = 1;\n@@ -25,7 +28,7 @@ skip_reset = 0;\n# 1 = insert CRC for payload integrity checking\n# 0 = do not insert CRC\n# SCM C code must also be set up for CRC check for this to work\n-insert_CRC = 1;\n+insert_CRC = 0;\n# 1 = pad unused payload space with random data and check it with CRC\n# 0 = pad with zeros, do not check integrity of padding\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. don't insert crc (to be debug why crc failed) and print the bin file path.
|
491,595 |
09.04.2019 17:04:02
| 25,200 |
6cbb5cebb22f28f3bd23e90781ba8792eaf25752
|
project bsp_sctimer passed.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board.c",
"new_path": "bsp/boards/scum/board.c",
"diff": "@@ -87,7 +87,7 @@ void board_init(void) {\ndebugpins_init();\nleds_init();\nuart_init();\n-// sctimer_init();\n+ sctimer_init();\n// radio_init();\n// eui64_get(eui);\n}\n@@ -249,9 +249,7 @@ void board_optical_calibration(void){\n// Enable optical SFD interrupt for optical calibration\nISER = 0x0800;\n- while(optical_cal_finished == 0) {\n- leds_all_toggle();\n- }\n+ while(optical_cal_finished == 0);\noptical_cal_finished = 0;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_sctimer/01bsp_sctimer.uvprojx",
"new_path": "projects/scum/01bsp_sctimer/01bsp_sctimer.uvprojx",
"diff": "<FileType>5</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n</File>\n+ <File>\n+ <FileName>bucket_o_functions.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\bucket_o_functions.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>bucket_o_functions.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\bucket_o_functions.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>retarget.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\retarget.c</FilePath>\n+ </File>\n</Files>\n</Group>\n</Groups>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-833. project bsp_sctimer passed.
|
491,595 |
10.04.2019 11:15:27
| 25,200 |
d04b3ede9211cc303c9a092b57d3817bebc68306
|
update the bsp_sctimer compare value converting.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -34,13 +34,6 @@ to return the board's description.\n// ==== SCuM RF timer specific\n-// with the setup of FPGA board +teensy, the rftimer clock is\n-// 20MHz divided by 255 (around 78431Hz), the following code is converting\n-// between 32768Hz and 78431Hz, the ratio between them is around 2 and 5\n-// NOTICE:\n-// 1) 255 is the maxium value can be divided.\n-// 2) on FPGA, 20MHz clock can't be slow down.\n-\n// NOTE:\n// This convert has a problem that when multiple the value, it may exceeds\n// 0xffffffff, resulting a wrong converting. Resolve this problem when the\n@@ -48,10 +41,10 @@ to return the board's description.\n// this is called when require to WRITE the RFTIMER counter/compare registers,\n// where the value is going to be multiplied.\n-#define TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(value) value*5/2\n+#define TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(value) value*61/4\n// this is called when require to READ the RFTIMER counter/compare registers,\n// where the value is going to be divided.\n-#define TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(value) value*2/5\n+#define TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(value) value*4/61\n//===== radio\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-833. update the bsp_sctimer compare value converting.
|
491,595 |
10.04.2019 13:49:30
| 25,200 |
5c38fe2d5dd634e657cf8f8eb0fe933b5ec04f3c
|
add a new bsp_radio.c for scum.
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/scum/01bsp_radio/01bsp_radio.c",
"diff": "+/**\n+\\brief This program shows the use of the \"radio\" bsp module.\n+\n+Since the bsp modules for different platforms have the same declaration, you\n+can use this project with any platform.\n+\n+After loading this program, your board will switch on its radio on frequency\n+CHANNEL.\n+\n+While receiving a packet (i.e. from the start of frame event to the end of\n+frame event), it will turn on its sync LED.\n+\n+Every TIMER_PERIOD, it will also send a packet containing LENGTH_PACKET bytes\n+set to ID. While sending a packet (i.e. from the start of frame event to the\n+end of frame event), it will turn on its error LED.\n+\n+\\author Thomas Watteyne <watteyne@eecs.berkeley.edu>, August 2014.\n+*/\n+\n+#include \"board.h\"\n+#include \"radio.h\"\n+#include \"leds.h\"\n+#include \"sctimer.h\"\n+\n+//=========================== defines =========================================\n+\n+#define LENGTH_PACKET 125+LENGTH_CRC ///< maximum length is 127 bytes\n+#define CHANNEL 11 ///< 11=2.405GHz\n+#define TIMER_PERIOD 0xffff ///< 0xffff = 2s@32kHz\n+#define ID 0x99 ///< byte sent in the packets\n+\n+//=========================== variables =======================================\n+\n+enum {\n+ APP_FLAG_START_FRAME = 0x01,\n+ APP_FLAG_END_FRAME = 0x02,\n+ APP_FLAG_TIMER = 0x04,\n+};\n+\n+typedef enum {\n+ APP_STATE_TX = 0x01,\n+ APP_STATE_RX = 0x02,\n+} app_state_t;\n+\n+typedef struct {\n+ uint8_t num_startFrame;\n+ uint8_t num_endFrame;\n+ uint8_t num_timer;\n+} app_dbg_t;\n+\n+app_dbg_t app_dbg;\n+\n+typedef struct {\n+ uint8_t flags;\n+ app_state_t state;\n+ uint8_t packet[LENGTH_PACKET];\n+ uint8_t packet_len;\n+ int8_t rxpk_rssi;\n+ uint8_t rxpk_lqi;\n+ bool rxpk_crc;\n+} app_vars_t;\n+\n+app_vars_t app_vars;\n+\n+//=========================== prototypes ======================================\n+\n+void cb_startFrame(PORT_TIMER_WIDTH timestamp);\n+void cb_endFrame(PORT_TIMER_WIDTH timestamp);\n+void cb_timer(void);\n+\n+//=========================== main ============================================\n+\n+/**\n+\\brief The program starts executing here.\n+*/\n+int mote_main(void) {\n+ uint8_t i;\n+\n+ // clear local variables\n+ memset(&app_vars,0,sizeof(app_vars_t));\n+\n+ // initialize board\n+ board_init();\n+\n+ // add callback functions radio\n+ radio_setStartFrameCb(cb_startFrame);\n+ radio_setEndFrameCb(cb_endFrame);\n+\n+ // prepare packet\n+ app_vars.packet_len = sizeof(app_vars.packet);\n+ for (i=0;i<app_vars.packet_len;i++) {\n+ app_vars.packet[i] = ID;\n+ }\n+\n+ // start bsp timer\n+ sctimer_set_callback(cb_timer);\n+ sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);\n+ sctimer_enable();\n+\n+ // prepare radio\n+ radio_rfOn();\n+ radio_setFrequency(CHANNEL, APP_STATE_RX);\n+\n+ // switch in RX by default\n+ radio_rxEnable();\n+ app_vars.state = APP_STATE_RX;\n+\n+ // start by a transmit\n+ app_vars.flags |= APP_FLAG_TIMER;\n+\n+ while (1) {\n+\n+ // sleep while waiting for at least one of the flags to be set\n+ while (app_vars.flags==0x00) {\n+ board_sleep();\n+ }\n+\n+ // handle and clear every flag\n+ while (app_vars.flags) {\n+\n+\n+ //==== APP_FLAG_START_FRAME (TX or RX)\n+\n+ if (app_vars.flags & APP_FLAG_START_FRAME) {\n+ // start of frame\n+\n+ switch (app_vars.state) {\n+ case APP_STATE_RX:\n+ // started receiving a packet\n+\n+ // led\n+ leds_error_on();\n+ break;\n+ case APP_STATE_TX:\n+ // started sending a packet\n+\n+ // led\n+ leds_sync_on();\n+ break;\n+ }\n+\n+ // clear flag\n+ app_vars.flags &= ~APP_FLAG_START_FRAME;\n+ }\n+\n+\n+ //==== APP_FLAG_END_FRAME (TX or RX)\n+\n+ if (app_vars.flags & APP_FLAG_END_FRAME) {\n+ // end of frame\n+\n+ switch (app_vars.state) {\n+\n+ case APP_STATE_RX:\n+\n+ // done receiving a packet\n+ app_vars.packet_len = sizeof(app_vars.packet);\n+\n+ // get packet from radio\n+ radio_getReceivedFrame(\n+ app_vars.packet,\n+ &app_vars.packet_len,\n+ sizeof(app_vars.packet),\n+ &app_vars.rxpk_rssi,\n+ &app_vars.rxpk_lqi,\n+ &app_vars.rxpk_crc\n+ );\n+\n+ // led\n+ leds_error_off();\n+ break;\n+ case APP_STATE_TX:\n+ // done sending a packet\n+\n+ radio_setFrequency(CHANNEL, APP_STATE_RX);\n+\n+ // switch to RX mode\n+ radio_rxEnable();\n+ app_vars.state = APP_STATE_RX;\n+\n+ // led\n+ leds_sync_off();\n+ break;\n+ }\n+ // clear flag\n+ app_vars.flags &= ~APP_FLAG_END_FRAME;\n+ }\n+\n+\n+ //==== APP_FLAG_TIMER\n+\n+ if (app_vars.flags & APP_FLAG_TIMER) {\n+ // timer fired\n+\n+ if (app_vars.state==APP_STATE_RX) {\n+ // stop listening\n+ radio_rfOff();\n+\n+ // prepare packet\n+ app_vars.packet_len = sizeof(app_vars.packet);\n+ for (i=0;i<app_vars.packet_len;i++) {\n+ app_vars.packet[i] = ID;\n+ }\n+\n+ radio_setFrequency(CHANNEL, APP_STATE_TX);\n+\n+ // start transmitting packet\n+ radio_loadPacket(app_vars.packet,app_vars.packet_len);\n+ radio_txEnable();\n+ radio_txNow();\n+\n+ app_vars.state = APP_STATE_TX;\n+ }\n+\n+ // clear flag\n+ app_vars.flags &= ~APP_FLAG_TIMER;\n+ }\n+ }\n+ }\n+}\n+\n+//=========================== callbacks =======================================\n+\n+void cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n+ // set flag\n+ app_vars.flags |= APP_FLAG_START_FRAME;\n+\n+ // update debug stats\n+ app_dbg.num_startFrame++;\n+}\n+\n+void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n+ // set flag\n+ app_vars.flags |= APP_FLAG_END_FRAME;\n+\n+ // update debug stats\n+ app_dbg.num_endFrame++;\n+}\n+\n+void cb_timer(void) {\n+ // set flag\n+ app_vars.flags |= APP_FLAG_TIMER;\n+\n+ // update debug stats\n+ app_dbg.num_timer++;\n+\n+ sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_radio/01bsp_radio.uvprojx",
"new_path": "projects/scum/01bsp_radio/01bsp_radio.uvprojx",
"diff": "<File>\n<FileName>01bsp_radio.c</FileName>\n<FileType>1</FileType>\n- <FilePath>..\\..\\common\\01bsp_radio\\01bsp_radio.c</FilePath>\n+ <FilePath>.\\01bsp_radio.c</FilePath>\n</File>\n</Files>\n</Group>\n<FileType>5</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n</File>\n+ <File>\n+ <FileName>bucket_o_functions.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\bucket_o_functions.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>bucket_o_functions.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\bucket_o_functions.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>retarget.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\retarget.c</FilePath>\n+ </File>\n</Files>\n</Group>\n</Groups>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-833. add a new bsp_radio.c for scum.
|
491,595 |
10.04.2019 20:32:08
| 25,200 |
44c7503456cb30c0891bb6c8789f548608d08e67
|
Update bsp_radio projects.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board.c",
"new_path": "bsp/boards/scum/board.c",
"diff": "@@ -22,6 +22,9 @@ extern char send_packet[127];\nextern unsigned int ASC[38];\nextern unsigned int ASC_FPGA[38];\n+extern unsigned int RX_channel_codes[16];\n+extern unsigned int TX_channel_codes[16];\n+\n// Bootloader will insert length and pre-calculated CRC at these memory addresses\n#define crc_value (*((unsigned int *) 0x0000FFFC))\n#define code_length (*((unsigned int *) 0x0000FFF8))\n@@ -55,6 +58,7 @@ unsigned reverse(unsigned x);\nunsigned int crc32c(unsigned char *message, unsigned int length);\nvoid board_optical_calibration(void);\n+void build_channel_table(unsigned int channel_11_LC_code);\n//=========================== interrupt ========================================\n@@ -77,6 +81,10 @@ void board_init(void) {\nboard_optical_calibration();\n+ // measured in SwarmLab with room temperature\n+ RX_channel_codes[0] = 360;\n+ TX_channel_codes[0] = 410;\n+\n// set priority of interrupts\nIPR0 = 0xFF; // uart has lowest priority\n@@ -88,8 +96,8 @@ void board_init(void) {\nleds_init();\nuart_init();\nsctimer_init();\n-// radio_init();\n-// eui64_get(eui);\n+ radio_init();\n+ eui64_get(eui);\n}\nvoid board_sleep(void) {\n@@ -386,10 +394,17 @@ void optical_sfd_isr(void){\nanalog_scan_chain_load_3B_fromFPGA();\nif(optical_cal_iteration == 25){\n+ // disable optical interrupts\nICER = 0x0800;\n+\n+ // mark as finished\noptical_cal_iteration = 0;\noptical_cal_finished = 1;\n+ build_channel_table(LC_code);\n+\n+ radio_disable_all();\n+\n// Halt all counters\nANALOG_CFG_REG__0 = 0x0000;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/radio.c",
"new_path": "bsp/boards/scum/radio.c",
"diff": "#include \"debugpins.h\"\n#include \"leds.h\"\n#include \"memory_map.h\"\n+#include \"scm3_hardware_interface.h\"\n//=========================== defines =========================================\n#define DEFAULT_CRC_CHECK 0x01 // this is an arbitrary value for now\n#define DEFAULT_RSSI -50 // this is an arbitrary value for now\n+// ==== for calibration\n+\n+#define FREQ_UPDATE_TIMEOUT 15\n+\n//=========================== variables =======================================\n+extern unsigned int ASC[38];\n+extern unsigned int RX_channel_codes[16];\n+extern unsigned int TX_channel_codes[16];\n+\n+extern unsigned int LC_code;\n+\ntypedef struct {\nradio_capture_cbt startFrame_cb;\nradio_capture_cbt endFrame_cb;\nuint8_t radio_tx_buffer[MAXLENGTH_TRX_BUFFER] __attribute__ ((aligned (4)));\nuint8_t radio_rx_buffer[MAXLENGTH_TRX_BUFFER] __attribute__ ((aligned (4)));\nradio_state_t state;\n+ uint8_t current_frequency;\n} radio_vars_t;\nradio_vars_t radio_vars;\n+unsigned char FIR_coeff[11] = {4,16,37,64,87,96,87,64,37,16,4};\n+unsigned int IF_estimate_history[11] = {500,500,500,500,500,500,500,500,500,500};\n+signed short cdr_tau_history[11] = {0};\n+unsigned short frequency_update_cooldown_timer = 0;\n+signed short cdr_tau_value;\n+unsigned int LQI_chip_errors;\n+unsigned int IF_estimate;\n+\n+// MF IF clock settings\n+extern unsigned int IF_clk_target;\n+extern unsigned int IF_coarse;\n+extern unsigned int IF_fine;\n+\n//=========================== prototypes ======================================\n+void radio_calibration(void);\n+\n//=========================== public ==========================================\n//===== admin\n@@ -46,6 +73,10 @@ void radio_init(void) {\n// change state\nradio_vars.state = RADIOSTATE_STOPPED;\n+\n+ // Enable radio interrupts in NVIC\n+ ISER = 0x40;\n+\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n// enable sfd done and send done interruptions of tranmission\n// enable sfd done and receiving done interruptions of reception\n@@ -93,12 +124,80 @@ void radio_reset(void) {\n//===== RF admin\n-void radio_setFrequency(uint8_t frequency) {\n+\n+// Call this to setup RX, followed quickly by a TX ack\n+// Note that due to the two ASC program cycles, this function takes about 27ms to execute (@5MHz HCLK)\n+void setFrequencyRX(unsigned int channel){\n+\n+ // Set LO code for RX channel\n+ LC_monotonic_ASC(RX_channel_codes[channel-11]);\n+\n+ //printf(\"chan code = %d\\n\", RX_channel_codes[channel-11]);\n+\n+ // On FPGA, have to use the chip's GPIO outputs for radio signals\n+ // Note that can't reprogram while the RX is active\n+ GPO_control(2,10,1,1);\n+\n+ // Turn polyphase on for RX\n+ set_asc_bit(971);\n+\n+ // Enable mixer for RX\n+ clear_asc_bit(298);\n+ clear_asc_bit(307);\n+\n+ // Analog scan chain setup for radio LDOs for RX\n+ set_asc_bit(504); // = gpio_pon_en_if\n+ set_asc_bit(506); // = gpio_pon_en_lo\n+ clear_asc_bit(508); // = gpio_pon_en_pa\n+ clear_asc_bit(514); // = gpio_pon_en_div\n+\n+ // Write and load analog scan chain\n+ analog_scan_chain_write_3B_fromFPGA(&ASC[0]);\n+ analog_scan_chain_load_3B_fromFPGA();\n+}\n+\n+\n+// Call this to setup TX, followed quickly by a RX ack\n+void setFrequencyTX(unsigned int channel){\n+\n+ // Set LO code for TX channel\n+ LC_monotonic_ASC(TX_channel_codes[channel-11]);\n+\n+ // Turn polyphase off for TX\n+ clear_asc_bit(971);\n+\n+ // Hi-Z mixer wells for TX\n+ set_asc_bit(298);\n+ set_asc_bit(307);\n+\n+ // Analog scan chain setup for radio LDOs for TX\n+ clear_asc_bit(504); // = gpio_pon_en_if\n+ set_asc_bit(506); // = gpio_pon_en_lo\n+ set_asc_bit(508); // = gpio_pon_en_pa\n+ clear_asc_bit(514); // = gpio_pon_en_div\n+\n+ // Write and load analog scan chain\n+ analog_scan_chain_write_3B_fromFPGA(&ASC[0]);\n+ analog_scan_chain_load_3B_fromFPGA();\n+}\n+\n+void radio_setFrequency(uint8_t frequency, uint8_t tx_or_rx) {\n// change state\nradio_vars.state = RADIOSTATE_SETTING_FREQUENCY;\n- // not support by SCuM yet\n+ switch(tx_or_rx){\n+ case 0x01:\n+ setFrequencyTX(frequency);\n+ break;\n+ case 0x02:\n+ setFrequencyRX(frequency);\n+ break;\n+ default:\n+ // shouldn't happen\n+ break;\n+ }\n+ radio_vars.current_frequency = frequency;\n// change state\nradio_vars.state = RADIOSTATE_FREQUENCY_SET;\n@@ -114,7 +213,13 @@ void radio_rfOff(void) {\nradio_vars.state = RADIOSTATE_TURNING_OFF;\n// turn SCuM radio off\n- RFCONTROLLER_REG__CONTROL = RX_STOP;\n+ RFCONTROLLER_REG__CONTROL = RX_RESET;\n+\n+ // Hold digital baseband in reset\n+ ANALOG_CFG_REG__4 = 0x2000;\n+\n+ // Turn off LDOs\n+ ANALOG_CFG_REG__10 = 0x0000;\n// wiggle debug pin\ndebugpins_radio_clr();\n@@ -165,7 +270,8 @@ void radio_txEnable(void) {\n// change state\nradio_vars.state = RADIOSTATE_ENABLING_TX;\n- // not support by SCuM\n+ // turn on LO, PA, and AUX LDOs\n+ ANALOG_CFG_REG__10 = 0x00A8;\n// wiggle debug pin\ndebugpins_radio_set();\n@@ -191,16 +297,27 @@ void radio_rxEnable(void) {\n// change state\nradio_vars.state = RADIOSTATE_ENABLING_RX;\n+ // Turn on LO, IF, and AUX LDOs via memory mapped register\n+ ANALOG_CFG_REG__10 = 0x0098;\n+\n+ // reset\n+ RFCONTROLLER_REG__CONTROL = RX_RESET;\n+\n+ // set receiving buffer address\nDMA_REG__RF_RX_ADDR = &(radio_vars.radio_rx_buffer[0]);\n+\n+ // Reset digital baseband\n+ ANALOG_CFG_REG__4 = 0x2000;\n+ ANALOG_CFG_REG__4 = 0x2800;\n// start to listen\nRFCONTROLLER_REG__CONTROL = RX_START;\n+\n// wiggle debug pin\ndebugpins_radio_set();\nleds_radio_on();\n// change state\nradio_vars.state = RADIOSTATE_LISTENING;\n-\n}\nvoid radio_rxEnable_scum(void){\n@@ -241,6 +358,112 @@ void radio_getReceivedFrame(uint8_t* pBufRead,\n//=========================== private =========================================\n+void radio_calibration(void) {\n+\n+ signed int sum = 0;\n+ int jj;\n+ unsigned int IF_est_filtered;\n+ signed int chip_rate_error_ppm, chip_rate_error_ppm_filtered;\n+ unsigned short packet_len;\n+ signed int timing_correction;\n+\n+ packet_len = radio_vars.radio_rx_buffer[0];\n+\n+ // When updating LO and IF clock frequncies, must wait long enough for the changes to propagate before changing again\n+ // Need to receive as many packets as there are taps in the FIR filter\n+ frequency_update_cooldown_timer++;\n+\n+ // FIR filter for cdr tau slope\n+ sum = 0;\n+\n+ // A tau value of 0 indicates there is no rate mistmatch between the TX and RX chip clocks\n+ // The cdr_tau_value corresponds to the number of samples that were added or dropped by the CDR\n+ // Each sample point is 1/16MHz = 62.5ns\n+ // Need to estimate ppm error for each packet, then FIR those values to make tuning decisions\n+ // error_in_ppm = 1e6 * (#adjustments * 62.5ns) / (packet length (bytes) * 64 chips/byte * 500ns/chip)\n+ // Which can be simplified to (#adjustments * 15625) / (packet length * 8)\n+\n+ chip_rate_error_ppm = (cdr_tau_value * 15625) / (packet_len * 8);\n+\n+ // Shift old samples\n+ for (jj=9; jj>=0; jj--){\n+ cdr_tau_history[jj+1] = cdr_tau_history[jj];\n+ }\n+\n+ // New sample\n+ cdr_tau_history[0] = chip_rate_error_ppm;\n+\n+ // Do FIR convolution\n+ for (jj=0; jj<=10; jj++){\n+ sum = sum + cdr_tau_history[jj] * FIR_coeff[jj];\n+ }\n+\n+ // Divide by 512 (sum of the coefficients) to scale output\n+ chip_rate_error_ppm_filtered = sum / 512;\n+\n+ // The IF clock frequency steps are about 2000ppm, so make an adjustment only if the error is larger than 1000ppm\n+ // Must wait long enough between changes for FIR to settle (at least 10 packets)\n+ // Need to add some handling here in case the IF_fine code will rollover with this change (0 <= IF_fine <= 31)\n+ if(frequency_update_cooldown_timer == FREQ_UPDATE_TIMEOUT){\n+ if(chip_rate_error_ppm_filtered > 1000) {\n+ set_IF_clock_frequency(IF_coarse, IF_fine++, 0);\n+ }\n+ if(chip_rate_error_ppm_filtered < -1000) {\n+ set_IF_clock_frequency(IF_coarse, IF_fine--, 0);\n+ }\n+ }\n+\n+ // FIR filter for IF estimate\n+ sum = 0;\n+\n+ // The IF estimate reports how many zero crossings (both pos and neg) there were in a 100us period\n+ // The IF should on average be 2.5 MHz, which means the IF estimate will return ~500 when there is no IF error\n+ // Each tick is roughly 5 kHz of error\n+\n+ // Only make adjustments when the chip error rate is <10% (this value was picked as an arbitrary choice)\n+ // While packets can be received at higher chip error rates, the average IF estimate tends to be less accurate\n+ // Estimated chip_error_rate = LQI_chip_errors/256 (assuming the packet length was at least 8 Bytes)\n+ if(LQI_chip_errors < 25){\n+\n+ // Shift old samples\n+ for (jj=9; jj>=0; jj--){\n+ IF_estimate_history[jj+1] = IF_estimate_history[jj];\n+ }\n+\n+ // New sample\n+ IF_estimate_history[0] = IF_estimate;\n+\n+ // Do FIR convolution\n+ for (jj=0; jj<=10; jj++){\n+ sum = sum + IF_estimate_history[jj] * FIR_coeff[jj];\n+ }\n+\n+ // Divide by 512 (sum of the coefficients) to scale output\n+ IF_est_filtered = sum / 512;\n+\n+ //printf(\"%d - %d, %d\\n\",IF_estimate,IF_est_filtered,LQI_chip_errors);\n+\n+ // The LO frequency steps are about ~80-100 kHz, so make an adjustment only if the error is larger than that\n+ // These hysteresis bounds (+/- X) have not been optimized\n+ // Must wait long enough between changes for FIR to settle (at least as many packets as there are taps in the FIR)\n+ // For now, assume that TX/RX should both be updated, even though the IF information is only from the RX code\n+ if(frequency_update_cooldown_timer == FREQ_UPDATE_TIMEOUT){\n+ if(IF_est_filtered > 520){\n+ RX_channel_codes[radio_vars.current_frequency - 11]++;\n+ TX_channel_codes[radio_vars.current_frequency - 11]++;\n+ }\n+ if(IF_est_filtered < 480){\n+ RX_channel_codes[radio_vars.current_frequency - 11]--;\n+ TX_channel_codes[radio_vars.current_frequency - 11]--;\n+ }\n+\n+ frequency_update_cooldown_timer = 0;\n+ }\n+ }\n+\n+// printf(\"IF=%d, LQI=%d, CDR=%d, len=%d, LC=%d\\r\\n\",IF_estimate,LQI_chip_errors,cdr_tau_value,packet_len,LC_code);\n+}\n+\n//=========================== callbacks =======================================\n//=========================== interrupt handlers ==============================\n@@ -252,6 +475,12 @@ kick_scheduler_t radio_isr(void) {\nPORT_TIMER_WIDTH irq_status = RFCONTROLLER_REG__INT;\nPORT_TIMER_WIDTH irq_error = RFCONTROLLER_REG__ERROR;\n+ UART_REG__TX_DATA = irq_status + '0';\n+ UART_REG__TX_DATA = '-';\n+ UART_REG__TX_DATA = irq_error + '0';\n+ UART_REG__TX_DATA = '\\r';\n+ UART_REG__TX_DATA = '\\n';\n+\ndebugpins_isr_set();\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n@@ -279,6 +508,7 @@ kick_scheduler_t radio_isr(void) {\n// a SFD is just received, update radio state\nradio_vars.state = RADIOSTATE_RECEIVING;\n}\n+\nif (radio_vars.startFrame_cb!=NULL) {\n// call the callback\nradio_vars.startFrame_cb(capturedTime);\n@@ -302,6 +532,21 @@ kick_scheduler_t radio_isr(void) {\ncapturedTime = TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(RFTIMER_REG__CAPTURE3);\n#endif\nRFCONTROLLER_REG__INT_CLEAR = RX_DONE_INT;\n+\n+ // Only record IF estimate, LQI, and CDR tau for valid packets\n+ IF_estimate = read_IF_estimate();\n+ LQI_chip_errors = ANALOG_CFG_REG__21 & 0xFF; //read_LQI();\n+\n+ // Read the value of tau debug at end of packet\n+ // Do this later in the ISR to make sure this register has settled before trying to read it\n+ // (the register is on the adc clock domain)\n+ cdr_tau_value = ANALOG_CFG_REG__25;\n+\n+ radio_calibration();\n+\n+ // set the frequency to update the scan chain\n+ radio_setFrequency(11, 0x02);\n+ radio_rxEnable();\n}\n// the packet transmission or reception is done,\n// update the radio state\n@@ -321,10 +566,12 @@ kick_scheduler_t radio_isr(void) {\nRFCONTROLLER_REG__INT_CLEAR = TX_LOAD_DONE_INT;\n}\n- if (irq_error == 0) {\n+ if (irq_error != 0) {\n// error happens during the operation of radio. Print out the error here.\n// To Be Done. add error description deifinition for this type of errors.\nRFCONTROLLER_REG__ERROR_CLEAR = irq_error;\n+\n+ radio_rxEnable();\n}\ndebugpins_isr_clr();\nreturn DO_NOT_KICK_SCHEDULER;\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/scum/radio.h",
"diff": "+#ifndef __RADIO_H\n+#define __RADIO_H\n+\n+/**\n+\\addtogroup BSP\n+\\{\n+\\addtogroup radio\n+\\{\n+\n+\\brief Cross-platform declaration \"radio\" bsp module.\n+\n+\\author Thomas Watteyne <watteyne@eecs.berkeley.edu>, February 2012.\n+*/\n+\n+#include \"board.h\"\n+\n+//=========================== define ==========================================\n+\n+#define LENGTH_CRC 2\n+\n+/**\n+\\brief Current state of the radio.\n+\n+\\note This radio driver is very minimal in that it does not follow a state machine.\n+ It is up to the MAC layer to ensure that the different radio operations\n+ are called in the righr order. The radio keeps a state for debugging purposes only.\n+*/\n+typedef enum {\n+ RADIOSTATE_STOPPED = 0x00, ///< Completely stopped.\n+ RADIOSTATE_RFOFF = 0x01, ///< Listening for commands, but RF chain is off.\n+ RADIOSTATE_SETTING_FREQUENCY = 0x02, ///< Configuring the frequency.\n+ RADIOSTATE_FREQUENCY_SET = 0x03, ///< Done configuring the frequency.\n+ RADIOSTATE_LOADING_PACKET = 0x04, ///< Loading packet into the radio's TX buffer.\n+ RADIOSTATE_PACKET_LOADED = 0x05, ///< Packet is fully loaded in the radio's TX buffer.\n+ RADIOSTATE_ENABLING_TX = 0x06, ///< The RF TX chaing is being enabled (includes locking the PLL).\n+ RADIOSTATE_TX_ENABLED = 0x07, ///< Radio ready to transmit.\n+ RADIOSTATE_TRANSMITTING = 0x08, ///< Busy transmitting bytes.\n+ RADIOSTATE_ENABLING_RX = 0x09, ///< The RF RX chain is being enabled (includes locking the PLL).\n+ RADIOSTATE_LISTENING = 0x0a, ///< RF chain is on, listening, but no packet received yet.\n+ RADIOSTATE_RECEIVING = 0x0b, ///< Busy receiving bytes.\n+ RADIOSTATE_TXRX_DONE = 0x0c, ///< Frame has been sent/received completely.\n+ RADIOSTATE_TURNING_OFF = 0x0d, ///< Turning the RF chain off.\n+} radio_state_t;\n+\n+//=========================== typedef =========================================\n+\n+typedef void (*radio_capture_cbt)(PORT_TIMER_WIDTH timestamp);\n+\n+//=========================== variables =======================================\n+\n+//=========================== prototypes ======================================\n+\n+// admin\n+void radio_init(void);\n+void radio_setStartFrameCb(radio_capture_cbt cb);\n+void radio_setEndFrameCb(radio_capture_cbt cb);\n+// reset\n+void radio_reset(void);\n+// RF admin\n+void radio_setFrequency(uint8_t frequency, uint8_t tx_or_rx);\n+//void radio_setFrequency(uint8_t frequency);\n+void radio_rfOn(void);\n+void radio_rfOff(void);\n+// TX\n+#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n+void radio_loadPacket_prepare(uint8_t* packet, uint16_t len);\n+#endif\n+void radio_loadPacket(uint8_t* packet, uint16_t len);\n+void radio_txEnable(void);\n+void radio_txNow(void);\n+// RX\n+void radio_rxPacket_prepare(void);\n+void radio_rxEnable(void);\n+void radio_rxEnable_scum(void);\n+void radio_rxNow(void);\n+void radio_getReceivedFrame(uint8_t* bufRead,\n+ uint8_t* lenRead,\n+ uint8_t maxBufLen,\n+ int8_t* rssi,\n+ uint8_t* lqi,\n+ bool* crc);\n+\n+// interrupt handlers\n+kick_scheduler_t radio_isr(void);\n+\n+/**\n+\\}\n+\\}\n+*/\n+\n+#endif\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scm3_hardware_interface.c",
"new_path": "bsp/boards/scum/scm3_hardware_interface.c",
"diff": "@@ -11,6 +11,9 @@ unsigned int current_lfsr = 0x12345678;\n// coarse1, coarse2, coarse3, fine, superfine dac settings\nunsigned int dac_2M_settings[5] = {31, 31, 29, 2, 2};\n+unsigned int RX_channel_codes[16] = {0};\n+unsigned int TX_channel_codes[16] = {0};\n+\n// Reverse endianness of lower 16 bits\nunsigned int flip_lsb8(unsigned int in){\n@@ -1016,8 +1019,173 @@ void set_IF_clock_frequency(int coarse, int fine, int high_range){\n}\n}\n-void radio_enable_LO(){\n+void radio_enable_LO(void){\n// Turn on only LO via memory mapped register\nANALOG_CFG_REG__10 = 0x0008;\n}\n+\n+void radio_disable_all(void){\n+\n+ // Turn off LDOs\n+ ANALOG_CFG_REG__10 = 0x0000;\n+}\n+\n+\n+unsigned int build_RX_channel_table(unsigned int channel_11_LC_code){\n+\n+ unsigned int rdata_lsb,rdata_msb;\n+ int t,ii=0;\n+ unsigned int count_LC[16] = {0};\n+ unsigned int count_targets[17] = {0};\n+\n+ RX_channel_codes[0] = channel_11_LC_code;\n+\n+ //for(ii=0; ii<16; ii++){\n+ while(ii<16) {\n+\n+ LC_monotonic_ASC(RX_channel_codes[ii]);\n+ analog_scan_chain_write_3B_fromFPGA(&ASC[0]);\n+ analog_scan_chain_load_3B_fromFPGA();\n+\n+ // Reset all counters\n+ ANALOG_CFG_REG__0 = 0x0000;\n+\n+ // Enable all counters\n+ ANALOG_CFG_REG__0 = 0x3FFF;\n+\n+ // Count for some arbitrary amount of time\n+ for(t=1; t<16000; t++);\n+\n+ // Disable all counters\n+ ANALOG_CFG_REG__0 = 0x007F;\n+\n+ // Read count result\n+ rdata_lsb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x280000);\n+ rdata_msb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x2C0000);\n+ count_LC[ii] = rdata_lsb + (rdata_msb << 16);\n+\n+ count_targets[ii+1] = ((961+(ii+1)*2) * count_LC[0]) / 961;\n+\n+ // Adjust LC_code to match new target\n+ if(ii>0){\n+\n+ if(count_LC[ii] < (count_targets[ii] - 20)){\n+ RX_channel_codes[ii]++;\n+ }\n+ else{\n+ RX_channel_codes[ii+1] = RX_channel_codes[ii] + 40;\n+ ii++;\n+ }\n+ }\n+\n+ if(ii==0){\n+ RX_channel_codes[ii+1] = RX_channel_codes[ii] + 40;\n+ ii++;\n+ }\n+ }\n+\n+ for(ii=0; ii<16; ii++){\n+ printf(\"RX ch=%d, count_LC=%d, count_targets=%d, RX_channel_codes=%d\\r\\n\",ii+11,count_LC[ii],count_targets[ii],RX_channel_codes[ii]);\n+ }\n+\n+ return count_LC[0];\n+}\n+\n+\n+void build_TX_channel_table(unsigned int channel_11_LC_code, unsigned int count_LC_RX_ch11){\n+\n+ unsigned int rdata_lsb,rdata_msb;\n+ int t,ii=0;\n+ unsigned int count_LC[16] = {0};\n+ unsigned int count_targets[17] = {0};\n+\n+ unsigned short nums[16] = {802,904,929,269,949,434,369,578,455,970,139,297,587,109,373,159};\n+ unsigned short dens[16] = {801,901,924,267,940,429,364,569,447,951,136,290,572,106,362,154};\n+\n+\n+ // Need to adjust here for shift from PA\n+ TX_channel_codes[0] = channel_11_LC_code+30;\n+\n+\n+ //for(ii=0; ii<16; ii++){\n+ while(ii<16) {\n+\n+ LC_monotonic_ASC(TX_channel_codes[ii]);\n+ analog_scan_chain_write_3B_fromFPGA(&ASC[0]);\n+ analog_scan_chain_load_3B_fromFPGA();\n+\n+ // Reset all counters\n+ ANALOG_CFG_REG__0 = 0x0000;\n+\n+ // Enable all counters\n+ ANALOG_CFG_REG__0 = 0x3FFF;\n+\n+ // Count for some arbitrary amount of time\n+ for(t=1; t<16000; t++);\n+\n+ // Disable all counters\n+ ANALOG_CFG_REG__0 = 0x007F;\n+\n+ // Read count result\n+ rdata_lsb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x280000);\n+ rdata_msb = *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x2C0000);\n+ count_LC[ii] = rdata_lsb + (rdata_msb << 16);\n+\n+ // Until figure out why modulation spacing is only 800kHz, only set 400khz above RF channel\n+ count_targets[ii] = (nums[ii] * count_LC_RX_ch11) / dens[ii];\n+ //count_targets[ii] = ((24054 + ii*50) * count_LC_RX_ch11) / 24025;\n+ //count_targets[ii] = ((24055 + ii*50) * count_LC_RX_ch11) / 24025;\n+\n+ if(count_LC[ii] < (count_targets[ii] - 5)){\n+ TX_channel_codes[ii]++;\n+ }\n+ else{\n+ TX_channel_codes[ii+1] = TX_channel_codes[ii] + 40;\n+ ii++;\n+ }\n+ }\n+\n+ for(ii=0; ii<16; ii++){\n+ printf(\"\\r\\nTX ch=%d, count_LC=%d, count_targets=%d, TX_channel_codes=%d\\r\\n\",ii+11,count_LC[ii],count_targets[ii],TX_channel_codes[ii]);\n+ }\n+}\n+\n+void build_channel_table(unsigned int channel_11_LC_code){\n+\n+ unsigned int count_LC_RX_ch11;\n+\n+ // Make sure in RX mode first\n+\n+ count_LC_RX_ch11 = build_RX_channel_table(channel_11_LC_code);\n+\n+ //printf(\"--\\n\");\n+\n+ // Switch over to TX mode\n+\n+ // Turn polyphase off for TX\n+ clear_asc_bit(971);\n+\n+ // Hi-Z mixer wells for TX\n+ set_asc_bit(298);\n+ set_asc_bit(307);\n+\n+ // Analog scan chain setup for radio LDOs for RX\n+ clear_asc_bit(504); // = gpio_pon_en_if\n+ set_asc_bit(506); // = gpio_pon_en_lo\n+ set_asc_bit(508); // = gpio_pon_en_pa\n+\n+ build_TX_channel_table(channel_11_LC_code,count_LC_RX_ch11);\n+\n+ radio_disable_all();\n+}\n+\n+unsigned int read_IF_estimate(void){\n+ // Check valid flag\n+ if(ANALOG_CFG_REG__16 & 0x400) {\n+ return ANALOG_CFG_REG__16 & 0x3FF;\n+ } else {\n+ return 0;\n+ }\n+}\n+\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scm3_hardware_interface.h",
"new_path": "bsp/boards/scum/scm3_hardware_interface.h",
"diff": "@@ -37,8 +37,15 @@ void LC_FREQCHANGE_ASC(int coarse, int mid, int fine);\nvoid LC_monotonic_ASC(int LC_code);\nvoid radio_init_divider(unsigned int div_value);\nvoid radio_enable_LO(void);\n+void radio_disable_all(void);\nvoid set_IF_stg3gm_ASC(unsigned int Igm, unsigned int Qgm);\nvoid set_IF_gain_ASC(unsigned int Igain, unsigned int Qgain);\nvoid set_IF_comparator_trim_I(unsigned int ptrim, unsigned int ntrim);\nvoid set_IF_comparator_trim_Q(unsigned int ptrim, unsigned int ntrim);\n+\n+void build_channel_table(unsigned int channel_11_LC_code);\n+unsigned int build_RX_channel_table(unsigned int channel_11_LC_code);\n+void build_TX_channel_table(unsigned int channel_11_LC_code, unsigned int count_LC_RX_ch11);\n+\n+unsigned int read_IF_estimate(void);\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_radio/01bsp_radio.c",
"new_path": "projects/scum/01bsp_radio/01bsp_radio.c",
"diff": "@@ -26,8 +26,8 @@ end of frame event), it will turn on its error LED.\n#define LENGTH_PACKET 125+LENGTH_CRC ///< maximum length is 127 bytes\n#define CHANNEL 11 ///< 11=2.405GHz\n-#define TIMER_PERIOD 0xffff ///< 0xffff = 2s@32kHz\n-#define ID 0x99 ///< byte sent in the packets\n+#define TIMER_PERIOD 0xfff ///< 0xffff = 2s@32kHz\n+#define ID 0x66 ///< byte sent in the packets\n//=========================== variables =======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_radio/01bsp_radio.uvprojx",
"new_path": "projects/scum/01bsp_radio/01bsp_radio.uvprojx",
"diff": "<MiscControls></MiscControls>\n<Define></Define>\n<Undefine></Undefine>\n- <IncludePath>..\\..\\..\\bsp\\boards;..\\..\\..\\bsp\\boards\\scum</IncludePath>\n+ <IncludePath>..\\..\\..\\bsp\\boards\\scum;..\\..\\..\\bsp\\boards</IncludePath>\n</VariousControls>\n</Cads>\n<Aads>\n<FileType>5</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\leds.h</FilePath>\n</File>\n- <File>\n- <FileName>radio.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\bsp\\boards\\radio.h</FilePath>\n- </File>\n<File>\n<FileName>uart.h</FileName>\n<FileType>5</FileType>\n<FileType>1</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\retarget.c</FilePath>\n</File>\n+ <File>\n+ <FileName>radio.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\radio.h</FilePath>\n+ </File>\n</Files>\n</Group>\n</Groups>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-833. Update bsp_radio projects.
|
491,595 |
10.04.2019 21:50:11
| 25,200 |
2474b3b04ac0fee6920950f2b1c9deacd8c72450
|
update bsp_radio measured tx_channel code for channel 11.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board.c",
"new_path": "bsp/boards/scum/board.c",
"diff": "@@ -83,7 +83,7 @@ void board_init(void) {\n// measured in SwarmLab with room temperature\nRX_channel_codes[0] = 360;\n- TX_channel_codes[0] = 410;\n+ TX_channel_codes[0] = 412;\n// set priority of interrupts\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_radio/01bsp_radio.c",
"new_path": "projects/scum/01bsp_radio/01bsp_radio.c",
"diff": "@@ -192,7 +192,6 @@ int mote_main(void) {\nif (app_vars.flags & APP_FLAG_TIMER) {\n// timer fired\n- if (app_vars.state==APP_STATE_RX) {\n// stop listening\nradio_rfOff();\n@@ -210,7 +209,6 @@ int mote_main(void) {\nradio_txNow();\napp_vars.state = APP_STATE_TX;\n- }\n// clear flag\napp_vars.flags &= ~APP_FLAG_TIMER;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-833. update bsp_radio measured tx_channel code for channel 11.
|
491,595 |
11.04.2019 11:12:19
| 25,200 |
38da31fc63e48726c9451bc49d9d335a134cd3f8
|
apply xonxoff on scum and update slot duration.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -52,10 +52,10 @@ to return the board's description.\n//===== IEEE802154E timing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n//// time-slot related\n-#define PORT_TsSlotDuration 817 // 491 ticks = 15ms @32768Hz\n+#define PORT_TsSlotDuration 655 // 491 ticks = 15ms @32768Hz\n#define PORT_maxTxDataPrepare 100 // 66 ticks = 2013us @32768Hz\n#define PORT_maxRxAckPrepare 20 // 20 ticks = 610us @32768Hz\n#define PORT_maxRxDataPrepare 33 // 33 ticks = 1006us @32768Hz\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/uart.c",
"new_path": "bsp/boards/scum/uart.c",
"diff": "typedef struct {\nuart_tx_cbt txCb;\nuart_rx_cbt rxCb;\n+ bool fXonXoffEscaping;\n+ uint8_t xonXoffEscapedByte;\n} uart_vars_t;\nuart_vars_t uart_vars;\n@@ -36,7 +38,14 @@ void uart_setCallbacks(uart_tx_cbt txCb, uart_rx_cbt rxCb) {\n}\nvoid uart_writeByte(uint8_t byteToWrite){\n+\n+ if (byteToWrite==XON || byteToWrite==XOFF || byteToWrite==XONXOFF_ESCAPE) {\n+ uart_vars.fXonXoffEscaping = 0x01;\n+ uart_vars.xonXoffEscapedByte = byteToWrite;\n+ UART_REG__TX_DATA = XONXOFF_ESCAPE;\n+ } else {\nUART_REG__TX_DATA = byteToWrite;\n+ }\n// there is no txdone interruption, call the handler directly\nuart_tx_isr();\n}\n@@ -65,12 +74,25 @@ uint8_t uart_readByte(void) {\nreturn UART_REG__RX_DATA;\n}\n+void uart_setCTS(bool state){\n+ if (state==0x01) {\n+ UART_REG__TX_DATA = XON;\n+ } else {\n+ UART_REG__TX_DATA = XOFF;\n+ }\n+}\n+\n//=========================== interrupt handlers ==============================\nkick_scheduler_t uart_tx_isr(void) {\n+ if (uart_vars.fXonXoffEscaping==0x01) {\n+ uart_vars.fXonXoffEscaping = 0x00;\n+ UART_REG__TX_DATA = uart_vars.xonXoffEscapedByte^XONXOFF_MASK;\n+ } else {\nif (uart_vars.txCb != NULL){\nuart_vars.txCb();\n}\n+ }\nreturn DO_NOT_KICK_SCHEDULER;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-831. apply xonxoff on scum and update slot duration.
|
491,595 |
11.04.2019 16:56:02
| 25,200 |
f1150d5cb4031971d2a407a2734480c5edeffccc
|
update radio.c file.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/radio.c",
"new_path": "bsp/boards/scum/radio.c",
"diff": "#define DEFAULT_CRC_CHECK 0x01 // this is an arbitrary value for now\n#define DEFAULT_RSSI -50 // this is an arbitrary value for now\n+#define DEFAULT_FREQ 11 // since the LC calibration has some problem, just use the channel 11 for now\n// ==== for calibration\n@@ -185,20 +186,21 @@ void radio_setFrequency(uint8_t frequency, uint8_t tx_or_rx) {\n// change state\nradio_vars.state = RADIOSTATE_SETTING_FREQUENCY;\n+// radio_vars.current_frequency = frequency;\n+ radio_vars.current_frequency = DEFAULT_FREQ;\n+\nswitch(tx_or_rx){\ncase 0x01:\n- setFrequencyTX(frequency);\n+ setFrequencyTX(radio_vars.current_frequency);\nbreak;\ncase 0x02:\n- setFrequencyRX(frequency);\n+ setFrequencyRX(radio_vars.current_frequency);\nbreak;\ndefault:\n// shouldn't happen\nbreak;\n}\n- radio_vars.current_frequency = frequency;\n-\n// change state\nradio_vars.state = RADIOSTATE_FREQUENCY_SET;\n}\n@@ -461,6 +463,10 @@ void radio_calibration(void) {\n}\n}\n+ // Write and load analog scan chain\n+ analog_scan_chain_write_3B_fromFPGA(&ASC[0]);\n+ analog_scan_chain_load_3B_fromFPGA();\n+\n// printf(\"IF=%d, LQI=%d, CDR=%d, len=%d, LC=%d\\r\\n\",IF_estimate,LQI_chip_errors,cdr_tau_value,packet_len,LC_code);\n}\n@@ -475,11 +481,6 @@ kick_scheduler_t radio_isr(void) {\nPORT_TIMER_WIDTH irq_status = RFCONTROLLER_REG__INT;\nPORT_TIMER_WIDTH irq_error = RFCONTROLLER_REG__ERROR;\n- UART_REG__TX_DATA = irq_status + '0';\n- UART_REG__TX_DATA = '-';\n- UART_REG__TX_DATA = irq_error + '0';\n- UART_REG__TX_DATA = '\\r';\n- UART_REG__TX_DATA = '\\n';\ndebugpins_isr_set();\n@@ -544,8 +545,6 @@ kick_scheduler_t radio_isr(void) {\nradio_calibration();\n- // set the frequency to update the scan chain\n- radio_setFrequency(11, 0x02);\nradio_rxEnable();\n}\n// the packet transmission or reception is done,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-833. update radio.c file.
|
491,595 |
11.04.2019 17:23:02
| 25,200 |
27c1afcdd230e09729c14cfecad3a3c60ac1580f
|
Add sctimer_gpio project
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/scum/01bsp_sctimer_gpio/01bsp_sctimer_gpio.c",
"diff": "+/**\n+\\brief This program shows the use of the \"sctimer\" bsp module.\n+\n+Since the bsp modules for different platforms have the same declaration, you\n+can use this project with any platform.\n+\n+Load this program onto your board, and start running. It will enable the sctimer.\n+The sctimer is periodic, of period SCTIMER_PERIOD ticks. Each time it elapses:\n+ - the frame debugpin toggles\n+ - the error LED toggles\n+\n+\\author Tengfei Chang <tengfei.chang@eecs.berkeley.edu>, April 2017.\n+*/\n+\n+#include \"stdint.h\"\n+#include \"string.h\"\n+#include \"board.h\"\n+#include \"debugpins.h\"\n+#include \"leds.h\"\n+#include \"sctimer.h\"\n+\n+//=========================== defines =========================================\n+\n+#define SCTIMER_PERIOD 655 // @32kHz = 1s\n+\n+//=========================== variables =======================================\n+\n+typedef struct {\n+ uint16_t num_compare;\n+} app_vars_t;\n+\n+app_vars_t app_vars;\n+\n+//=========================== prototypes ======================================\n+\n+void cb_compare(void);\n+\n+//=========================== main ============================================\n+\n+/**\n+\\brief The program starts executing here.\n+*/\n+int mote_main(void) {\n+\n+ // initialize board.\n+ board_init();\n+\n+ sctimer_set_callback(cb_compare);\n+ sctimer_setCompare(sctimer_readCounter()+SCTIMER_PERIOD);\n+\n+ while (1) {\n+ debugpins_task_set();\n+ board_sleep();\n+ debugpins_task_clr();\n+ }\n+}\n+\n+//=========================== callbacks =======================================\n+\n+void cb_compare(void) {\n+\n+ // toggle pin\n+ debugpins_frame_toggle();\n+\n+ // toggle error led\n+ leds_error_toggle();\n+\n+ // increment counter\n+ app_vars.num_compare++;\n+\n+ // schedule again\n+ sctimer_setCompare(sctimer_readCounter()+SCTIMER_PERIOD);\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/scum/01bsp_sctimer_gpio/01bsp_sctimer_gpio.uvprojx",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n+<Project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"project_projx.xsd\">\n+\n+ <SchemaVersion>2.1</SchemaVersion>\n+\n+ <Header>### uVision Project, (C) Keil Software</Header>\n+\n+ <Targets>\n+ <Target>\n+ <TargetName>Target SCuM</TargetName>\n+ <ToolsetNumber>0x4</ToolsetNumber>\n+ <ToolsetName>ARM-ADS</ToolsetName>\n+ <pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>\n+ <uAC6>0</uAC6>\n+ <TargetOption>\n+ <TargetCommonOption>\n+ <Device>ARMCM0</Device>\n+ <Vendor>ARM</Vendor>\n+ <PackID>ARM.CMSIS.5.3.0</PackID>\n+ <PackURL>http://www.keil.com/pack/</PackURL>\n+ <Cpu>IRAM(0x20000000,0x00020000) IROM(0x00000000,0x00040000) CPUTYPE(\"Cortex-M0\") CLOCK(12000000) ESEL ELITTLE</Cpu>\n+ <FlashUtilSpec></FlashUtilSpec>\n+ <StartupFile></StartupFile>\n+ <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000)</FlashDriverDll>\n+ <DeviceId>0</DeviceId>\n+ <RegisterFile>$$Device:ARMCM0$Device\\ARM\\ARMCM0\\Include\\ARMCM0.h</RegisterFile>\n+ <MemoryEnv></MemoryEnv>\n+ <Cmp></Cmp>\n+ <Asm></Asm>\n+ <Linker></Linker>\n+ <OHString></OHString>\n+ <InfinionOptionDll></InfinionOptionDll>\n+ <SLE66CMisc></SLE66CMisc>\n+ <SLE66AMisc></SLE66AMisc>\n+ <SLE66LinkerMisc></SLE66LinkerMisc>\n+ <SFDFile>$$Device:ARMCM0$Device\\ARM\\SVD\\ARMCM0.svd</SFDFile>\n+ <bCustSvd>0</bCustSvd>\n+ <UseEnv>0</UseEnv>\n+ <BinPath></BinPath>\n+ <IncludePath></IncludePath>\n+ <LibPath></LibPath>\n+ <RegisterFilePath></RegisterFilePath>\n+ <DBRegisterFilePath></DBRegisterFilePath>\n+ <TargetStatus>\n+ <Error>0</Error>\n+ <ExitCodeStop>0</ExitCodeStop>\n+ <ButtonStop>0</ButtonStop>\n+ <NotGenerated>0</NotGenerated>\n+ <InvalidFlash>1</InvalidFlash>\n+ </TargetStatus>\n+ <OutputDirectory>.\\Objects\\</OutputDirectory>\n+ <OutputName>01bsp_sctimer_gpio</OutputName>\n+ <CreateExecutable>1</CreateExecutable>\n+ <CreateLib>0</CreateLib>\n+ <CreateHexFile>1</CreateHexFile>\n+ <DebugInformation>1</DebugInformation>\n+ <BrowseInformation>1</BrowseInformation>\n+ <ListingPath>.\\Listings\\</ListingPath>\n+ <HexFormatSelection>1</HexFormatSelection>\n+ <Merge32K>0</Merge32K>\n+ <CreateBatchFile>1</CreateBatchFile>\n+ <BeforeCompile>\n+ <RunUserProg1>0</RunUserProg1>\n+ <RunUserProg2>0</RunUserProg2>\n+ <UserProg1Name></UserProg1Name>\n+ <UserProg2Name></UserProg2Name>\n+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>\n+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>\n+ <nStopU1X>0</nStopU1X>\n+ <nStopU2X>0</nStopU2X>\n+ </BeforeCompile>\n+ <BeforeMake>\n+ <RunUserProg1>0</RunUserProg1>\n+ <RunUserProg2>0</RunUserProg2>\n+ <UserProg1Name></UserProg1Name>\n+ <UserProg2Name></UserProg2Name>\n+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>\n+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>\n+ <nStopB1X>0</nStopB1X>\n+ <nStopB2X>0</nStopB2X>\n+ </BeforeMake>\n+ <AfterMake>\n+ <RunUserProg1>1</RunUserProg1>\n+ <RunUserProg2>1</RunUserProg2>\n+ <UserProg1Name>fromelf --bin .\\Objects\\01bsp_sctimer_gpio.axf -o .\\Objects\\01bsp_sctimer_gpio.bin</UserProg1Name>\n+ <UserProg2Name>fromelf -cvf .\\Objects\\01bsp_sctimer_gpio.axf -o .\\Objects\\disasm.txt</UserProg2Name>\n+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>\n+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>\n+ <nStopA1X>0</nStopA1X>\n+ <nStopA2X>0</nStopA2X>\n+ </AfterMake>\n+ <SelectedForBatchBuild>0</SelectedForBatchBuild>\n+ <SVCSIdString></SVCSIdString>\n+ </TargetCommonOption>\n+ <CommonProperty>\n+ <UseCPPCompiler>0</UseCPPCompiler>\n+ <RVCTCodeConst>0</RVCTCodeConst>\n+ <RVCTZI>0</RVCTZI>\n+ <RVCTOtherData>0</RVCTOtherData>\n+ <ModuleSelection>0</ModuleSelection>\n+ <IncludeInBuild>1</IncludeInBuild>\n+ <AlwaysBuild>0</AlwaysBuild>\n+ <GenerateAssemblyFile>0</GenerateAssemblyFile>\n+ <AssembleAssemblyFile>0</AssembleAssemblyFile>\n+ <PublicsOnly>0</PublicsOnly>\n+ <StopOnExitCode>3</StopOnExitCode>\n+ <CustomArgument></CustomArgument>\n+ <IncludeLibraryModules></IncludeLibraryModules>\n+ <ComprImg>1</ComprImg>\n+ </CommonProperty>\n+ <DllOption>\n+ <SimDllName>SARMCM3.DLL</SimDllName>\n+ <SimDllArguments> </SimDllArguments>\n+ <SimDlgDll>DARMCM1.DLL</SimDlgDll>\n+ <SimDlgDllArguments>-pCM0</SimDlgDllArguments>\n+ <TargetDllName>SARMCM3.DLL</TargetDllName>\n+ <TargetDllArguments> </TargetDllArguments>\n+ <TargetDlgDll>TARMCM1.DLL</TargetDlgDll>\n+ <TargetDlgDllArguments>-pCM0</TargetDlgDllArguments>\n+ </DllOption>\n+ <DebugOption>\n+ <OPTHX>\n+ <HexSelection>1</HexSelection>\n+ <HexRangeLowAddress>0</HexRangeLowAddress>\n+ <HexRangeHighAddress>0</HexRangeHighAddress>\n+ <HexOffset>0</HexOffset>\n+ <Oh166RecLen>16</Oh166RecLen>\n+ </OPTHX>\n+ </DebugOption>\n+ <Utilities>\n+ <Flash1>\n+ <UseTargetDll>1</UseTargetDll>\n+ <UseExternalTool>0</UseExternalTool>\n+ <RunIndependent>0</RunIndependent>\n+ <UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>\n+ <Capability>1</Capability>\n+ <DriverSelection>4096</DriverSelection>\n+ </Flash1>\n+ <bUseTDR>1</bUseTDR>\n+ <Flash2>BIN\\UL2CM3.DLL</Flash2>\n+ <Flash3>\"\" ()</Flash3>\n+ <Flash4></Flash4>\n+ <pFcarmOut></pFcarmOut>\n+ <pFcarmGrp></pFcarmGrp>\n+ <pFcArmRoot></pFcArmRoot>\n+ <FcArmLst>0</FcArmLst>\n+ </Utilities>\n+ <TargetArmAds>\n+ <ArmAdsMisc>\n+ <GenerateListings>0</GenerateListings>\n+ <asHll>1</asHll>\n+ <asAsm>1</asAsm>\n+ <asMacX>1</asMacX>\n+ <asSyms>1</asSyms>\n+ <asFals>1</asFals>\n+ <asDbgD>1</asDbgD>\n+ <asForm>1</asForm>\n+ <ldLst>0</ldLst>\n+ <ldmm>1</ldmm>\n+ <ldXref>1</ldXref>\n+ <BigEnd>0</BigEnd>\n+ <AdsALst>1</AdsALst>\n+ <AdsACrf>1</AdsACrf>\n+ <AdsANop>0</AdsANop>\n+ <AdsANot>0</AdsANot>\n+ <AdsLLst>1</AdsLLst>\n+ <AdsLmap>1</AdsLmap>\n+ <AdsLcgr>1</AdsLcgr>\n+ <AdsLsym>1</AdsLsym>\n+ <AdsLszi>1</AdsLszi>\n+ <AdsLtoi>1</AdsLtoi>\n+ <AdsLsun>1</AdsLsun>\n+ <AdsLven>1</AdsLven>\n+ <AdsLsxf>1</AdsLsxf>\n+ <RvctClst>0</RvctClst>\n+ <GenPPlst>0</GenPPlst>\n+ <AdsCpuType>\"Cortex-M0\"</AdsCpuType>\n+ <RvctDeviceName></RvctDeviceName>\n+ <mOS>0</mOS>\n+ <uocRom>0</uocRom>\n+ <uocRam>0</uocRam>\n+ <hadIROM>1</hadIROM>\n+ <hadIRAM>1</hadIRAM>\n+ <hadXRAM>0</hadXRAM>\n+ <uocXRam>0</uocXRam>\n+ <RvdsVP>0</RvdsVP>\n+ <hadIRAM2>0</hadIRAM2>\n+ <hadIROM2>0</hadIROM2>\n+ <StupSel>8</StupSel>\n+ <useUlib>0</useUlib>\n+ <EndSel>1</EndSel>\n+ <uLtcg>0</uLtcg>\n+ <nSecure>0</nSecure>\n+ <RoSelD>3</RoSelD>\n+ <RwSelD>3</RwSelD>\n+ <CodeSel>0</CodeSel>\n+ <OptFeed>0</OptFeed>\n+ <NoZi1>0</NoZi1>\n+ <NoZi2>0</NoZi2>\n+ <NoZi3>0</NoZi3>\n+ <NoZi4>0</NoZi4>\n+ <NoZi5>0</NoZi5>\n+ <Ro1Chk>0</Ro1Chk>\n+ <Ro2Chk>0</Ro2Chk>\n+ <Ro3Chk>0</Ro3Chk>\n+ <Ir1Chk>1</Ir1Chk>\n+ <Ir2Chk>0</Ir2Chk>\n+ <Ra1Chk>0</Ra1Chk>\n+ <Ra2Chk>0</Ra2Chk>\n+ <Ra3Chk>0</Ra3Chk>\n+ <Im1Chk>1</Im1Chk>\n+ <Im2Chk>0</Im2Chk>\n+ <OnChipMemories>\n+ <Ocm1>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm1>\n+ <Ocm2>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm2>\n+ <Ocm3>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm3>\n+ <Ocm4>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm4>\n+ <Ocm5>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm5>\n+ <Ocm6>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm6>\n+ <IRAM>\n+ <Type>0</Type>\n+ <StartAddress>0x20000000</StartAddress>\n+ <Size>0x20000</Size>\n+ </IRAM>\n+ <IROM>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x40000</Size>\n+ </IROM>\n+ <XRAM>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </XRAM>\n+ <OCR_RVCT1>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT1>\n+ <OCR_RVCT2>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT2>\n+ <OCR_RVCT3>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT3>\n+ <OCR_RVCT4>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x10000</Size>\n+ </OCR_RVCT4>\n+ <OCR_RVCT5>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT5>\n+ <OCR_RVCT6>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT6>\n+ <OCR_RVCT7>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT7>\n+ <OCR_RVCT8>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT8>\n+ <OCR_RVCT9>\n+ <Type>0</Type>\n+ <StartAddress>0x20000000</StartAddress>\n+ <Size>0x10000</Size>\n+ </OCR_RVCT9>\n+ <OCR_RVCT10>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT10>\n+ </OnChipMemories>\n+ <RvctStartVector></RvctStartVector>\n+ </ArmAdsMisc>\n+ <Cads>\n+ <interw>1</interw>\n+ <Optim>1</Optim>\n+ <oTime>0</oTime>\n+ <SplitLS>0</SplitLS>\n+ <OneElfS>1</OneElfS>\n+ <Strict>0</Strict>\n+ <EnumInt>0</EnumInt>\n+ <PlainCh>0</PlainCh>\n+ <Ropi>0</Ropi>\n+ <Rwpi>0</Rwpi>\n+ <wLevel>2</wLevel>\n+ <uThumb>0</uThumb>\n+ <uSurpInc>0</uSurpInc>\n+ <uC99>1</uC99>\n+ <uGnu>0</uGnu>\n+ <useXO>0</useXO>\n+ <v6Lang>1</v6Lang>\n+ <v6LangP>1</v6LangP>\n+ <vShortEn>1</vShortEn>\n+ <vShortWch>1</vShortWch>\n+ <v6Lto>0</v6Lto>\n+ <v6WtE>0</v6WtE>\n+ <v6Rtti>0</v6Rtti>\n+ <VariousControls>\n+ <MiscControls></MiscControls>\n+ <Define></Define>\n+ <Undefine></Undefine>\n+ <IncludePath>..\\..\\..\\bsp\\boards;..\\..\\..\\bsp\\boards\\scum</IncludePath>\n+ </VariousControls>\n+ </Cads>\n+ <Aads>\n+ <interw>1</interw>\n+ <Ropi>0</Ropi>\n+ <Rwpi>0</Rwpi>\n+ <thumb>1</thumb>\n+ <SplitLS>0</SplitLS>\n+ <SwStkChk>0</SwStkChk>\n+ <NoWarn>0</NoWarn>\n+ <uSurpInc>0</uSurpInc>\n+ <useXO>0</useXO>\n+ <uClangAs>0</uClangAs>\n+ <VariousControls>\n+ <MiscControls></MiscControls>\n+ <Define></Define>\n+ <Undefine></Undefine>\n+ <IncludePath></IncludePath>\n+ </VariousControls>\n+ </Aads>\n+ <LDads>\n+ <umfTarg>1</umfTarg>\n+ <Ropi>0</Ropi>\n+ <Rwpi>0</Rwpi>\n+ <noStLib>0</noStLib>\n+ <RepFail>1</RepFail>\n+ <useFile>0</useFile>\n+ <TextAddressRange>0x00000000</TextAddressRange>\n+ <DataAddressRange>0x20000000</DataAddressRange>\n+ <pXoBase></pXoBase>\n+ <ScatterFile></ScatterFile>\n+ <IncludeLibs></IncludeLibs>\n+ <IncludeLibsPath></IncludeLibsPath>\n+ <Misc></Misc>\n+ <LinkerInputFile></LinkerInputFile>\n+ <DisabledWarnings></DisabledWarnings>\n+ </LDads>\n+ </TargetArmAds>\n+ </TargetOption>\n+ <Groups>\n+ <Group>\n+ <GroupName>application</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>01bsp_sctimer_gpio.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>.\\01bsp_sctimer_gpio.c</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>startUp</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>cm0dsasm.s</FileName>\n+ <FileType>2</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\cm0dsasm.s</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>boards</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>board.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\board.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>debugpins.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\debugpins.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>eui64.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\eui64.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>leds.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\leds.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>radio.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\radio.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sctimer.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\sctimer.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>uart.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\uart.h</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>scum</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>board.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\board.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>debugpins.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\debugpins.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>eui64.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\eui64.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>leds.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\leds.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>radio.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\radio.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sctimer.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\sctimer.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>uart.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\uart.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>board_info.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\board_info.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>memory_map.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\memory_map.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>bucket_o_functions.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\bucket_o_functions.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>bucket_o_functions.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\bucket_o_functions.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>retarget.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\retarget.c</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ </Groups>\n+ </Target>\n+ </Targets>\n+\n+ <RTE>\n+ <apis/>\n+ <components/>\n+ <files/>\n+ </RTE>\n+\n+</Project>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. Add sctimer_gpio project
|
491,595 |
24.04.2019 19:51:08
| -7,200 |
bfbc52f07a9b51415db2a068bea58fddcbf03269
|
format the calibration code.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/radio.c",
"new_path": "bsp/boards/scum/radio.c",
"diff": "// ==== for calibration\n-#define FREQ_UPDATE_TIMEOUT 15\n+#define IF_FREQ_UPDATE_TIMEOUT 10\n+#define LO_FREQ_UPDATE_TIMEOUT 10\n+#define FILTER_WINDOWS_LEN 11\n+#define FIR_COEFF_SCALE 512 // determined by FIR_coeff\n//=========================== variables =======================================\n@@ -46,10 +49,11 @@ typedef struct {\nradio_vars_t radio_vars;\n-unsigned char FIR_coeff[11] = {4,16,37,64,87,96,87,64,37,16,4};\n-unsigned int IF_estimate_history[11] = {500,500,500,500,500,500,500,500,500,500};\n-signed short cdr_tau_history[11] = {0};\n-unsigned short frequency_update_cooldown_timer = 0;\n+unsigned char FIR_coeff[FILTER_WINDOWS_LEN] = {4, 16, 37, 64, 87, 96, 87, 64, 37, 16, 4};\n+unsigned int IF_estimate_history[FILTER_WINDOWS_LEN] = {500,500,500,500,500,500,500,500,500,500,500};\n+signed short cdr_tau_history[FILTER_WINDOWS_LEN] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n+unsigned short IF_freq_freshness_timeout = 0;\n+unsigned short LO_freq_freshness_timeout = 0;\nsigned short cdr_tau_value;\nunsigned int LQI_chip_errors;\nunsigned int IF_estimate;\n@@ -355,27 +359,37 @@ void radio_getReceivedFrame(uint8_t* pBufRead,\n*pLenRead = radio_vars.radio_rx_buffer[0];\n//===== packet\n+ if (*pLenRead<=maxBufLen) {\nmemcpy(pBufRead,&(radio_vars.radio_rx_buffer[1]),*pLenRead);\n}\n+}\n//=========================== private =========================================\nvoid radio_calibration(void) {\n- signed int sum = 0;\n- int jj;\n- unsigned int IF_est_filtered;\n- signed int chip_rate_error_ppm, chip_rate_error_ppm_filtered;\n- unsigned short packet_len;\n- signed int timing_correction;\n+ int8_t i;\n+ uint8_t packet_len;\n+ uint32_t IF_est_filtered;\n+ int32_t chip_rate_error_ppm;\n+ int32_t chip_rate_error_ppm_filtered;\n+ int32_t sum;\npacket_len = radio_vars.radio_rx_buffer[0];\n+ if( packet_len==0x0a){\n+\n// When updating LO and IF clock frequncies, must wait long enough for the changes to propagate before changing again\n// Need to receive as many packets as there are taps in the FIR filter\n- frequency_update_cooldown_timer++;\n+ IF_freq_freshness_timeout++;\n+ LO_freq_freshness_timeout++;\n+\n+ printf(\"IF_estimate=%d, cdr_tau_value=%d LQI_chip_errors=%d\\r\\n\",IF_estimate,cdr_tau_value,LQI_chip_errors);\n+\n+ // ==== FIR filter for cdr tau slope ====\n+\n+ // the IF clock is for receiver chip clock\n- // FIR filter for cdr tau slope\nsum = 0;\n// A tau value of 0 indicates there is no rate mistmatch between the TX and RX chip clocks\n@@ -388,34 +402,38 @@ void radio_calibration(void) {\nchip_rate_error_ppm = (cdr_tau_value * 15625) / (packet_len * 8);\n// Shift old samples\n- for (jj=9; jj>=0; jj--){\n- cdr_tau_history[jj+1] = cdr_tau_history[jj];\n+ for (i=FILTER_WINDOWS_LEN-2; i>=0; i--){\n+ cdr_tau_history[i+1] = cdr_tau_history[i];\n}\n// New sample\ncdr_tau_history[0] = chip_rate_error_ppm;\n// Do FIR convolution\n- for (jj=0; jj<=10; jj++){\n- sum = sum + cdr_tau_history[jj] * FIR_coeff[jj];\n+ for (i=0; i<FILTER_WINDOWS_LEN; i++){\n+ sum = sum + cdr_tau_history[i] * FIR_coeff[i];\n}\n// Divide by 512 (sum of the coefficients) to scale output\n- chip_rate_error_ppm_filtered = sum / 512;\n+ chip_rate_error_ppm_filtered = sum / FIR_COEFF_SCALE;\n// The IF clock frequency steps are about 2000ppm, so make an adjustment only if the error is larger than 1000ppm\n// Must wait long enough between changes for FIR to settle (at least 10 packets)\n// Need to add some handling here in case the IF_fine code will rollover with this change (0 <= IF_fine <= 31)\n- if(frequency_update_cooldown_timer == FREQ_UPDATE_TIMEOUT){\n+ if(IF_freq_freshness_timeout >= IF_FREQ_UPDATE_TIMEOUT){\nif(chip_rate_error_ppm_filtered > 1000) {\nset_IF_clock_frequency(IF_coarse, IF_fine++, 0);\n}\nif(chip_rate_error_ppm_filtered < -1000) {\nset_IF_clock_frequency(IF_coarse, IF_fine--, 0);\n}\n+ IF_freq_freshness_timeout = 0;\n+\n+ printf(\"chip_rate_error_ppm = %d, chip_rate_error_ppm_filtered = %d \\r\\n\", chip_rate_error_ppm, chip_rate_error_ppm_filtered);\n}\n- // FIR filter for IF estimate\n+ // ==== FIR filter for IF estimate ====\n+\nsum = 0;\n// The IF estimate reports how many zero crossings (both pos and neg) there were in a 100us period\n@@ -424,32 +442,30 @@ void radio_calibration(void) {\n// Only make adjustments when the chip error rate is <10% (this value was picked as an arbitrary choice)\n// While packets can be received at higher chip error rates, the average IF estimate tends to be less accurate\n- // Estimated chip_error_rate = LQI_chip_errors/256 (assuming the packet length was at least 8 Bytes)\n- if(LQI_chip_errors < 25){\n+ // Estimated chip_error_rate = LQI_chip_errors/256 (assuming the packet length was at least 8 symbols)\n+// if(LQI_chip_errors < 25){\n// Shift old samples\n- for (jj=9; jj>=0; jj--){\n- IF_estimate_history[jj+1] = IF_estimate_history[jj];\n+ for (i=FILTER_WINDOWS_LEN-2; i>=0; i--){\n+ IF_estimate_history[i+1] = IF_estimate_history[i];\n}\n// New sample\nIF_estimate_history[0] = IF_estimate;\n// Do FIR convolution\n- for (jj=0; jj<=10; jj++){\n- sum = sum + IF_estimate_history[jj] * FIR_coeff[jj];\n+ for (i=0; i<FILTER_WINDOWS_LEN; i++){\n+ sum = sum + IF_estimate_history[i] * FIR_coeff[i];\n}\n+ IF_est_filtered = sum / FIR_COEFF_SCALE;\n- // Divide by 512 (sum of the coefficients) to scale output\n- IF_est_filtered = sum / 512;\n-\n- //printf(\"%d - %d, %d\\n\",IF_estimate,IF_est_filtered,LQI_chip_errors);\n+ printf(\"IF_estimate = %d, IF_est_filtered = %d \\r\\n\", IF_estimate, IF_est_filtered);\n// The LO frequency steps are about ~80-100 kHz, so make an adjustment only if the error is larger than that\n// These hysteresis bounds (+/- X) have not been optimized\n// Must wait long enough between changes for FIR to settle (at least as many packets as there are taps in the FIR)\n// For now, assume that TX/RX should both be updated, even though the IF information is only from the RX code\n- if(frequency_update_cooldown_timer == FREQ_UPDATE_TIMEOUT){\n+ if(LO_freq_freshness_timeout >= LO_FREQ_UPDATE_TIMEOUT){\nif(IF_est_filtered > 520){\nRX_channel_codes[radio_vars.current_frequency - 11]++;\nTX_channel_codes[radio_vars.current_frequency - 11]++;\n@@ -459,15 +475,17 @@ void radio_calibration(void) {\nTX_channel_codes[radio_vars.current_frequency - 11]--;\n}\n- frequency_update_cooldown_timer = 0;\n- }\n+ LO_freq_freshness_timeout = 0;\n+\n+ printf(\"IF_estimate = %d, IF_est_filtered = %d \\r\\n\", IF_estimate, IF_est_filtered);\n}\n+// }\n// Write and load analog scan chain\n+\nanalog_scan_chain_write_3B_fromFPGA(&ASC[0]);\nanalog_scan_chain_load_3B_fromFPGA();\n-\n-// printf(\"IF=%d, LQI=%d, CDR=%d, len=%d, LC=%d\\r\\n\",IF_estimate,LQI_chip_errors,cdr_tau_value,packet_len,LC_code);\n+ }\n}\n//=========================== callbacks =======================================\n@@ -542,10 +560,6 @@ kick_scheduler_t radio_isr(void) {\n// Do this later in the ISR to make sure this register has settled before trying to read it\n// (the register is on the adc clock domain)\ncdr_tau_value = ANALOG_CFG_REG__25;\n-\n- radio_calibration();\n-\n- radio_rxEnable();\n}\n// the packet transmission or reception is done,\n// update the radio state\n@@ -553,6 +567,12 @@ kick_scheduler_t radio_isr(void) {\nif (radio_vars.endFrame_cb!=NULL) {\n// call the callback\nradio_vars.endFrame_cb(capturedTime);\n+\n+ if (irq_status & RX_DONE_INT) {\n+ radio_calibration();\n+ radio_rxEnable();\n+ }\n+\ndebugpins_isr_clr();\n// kick the OS\nreturn KICK_SCHEDULER;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. format the calibration code.
|
491,595 |
24.04.2019 19:53:45
| -7,200 |
52cebf6835b86a443b5a43c90b811919a5fdaf31
|
use a roughly 163KHz RFTimer clock.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board.c",
"new_path": "bsp/boards/scum/board.c",
"diff": "@@ -82,8 +82,8 @@ void board_init(void) {\nboard_optical_calibration();\n// measured in SwarmLab with room temperature\n- RX_channel_codes[0] = 360;\n- TX_channel_codes[0] = 412;\n+ RX_channel_codes[0] = 363;\n+ TX_channel_codes[0] = 417;\n// set priority of interrupts\n@@ -101,6 +101,9 @@ void board_init(void) {\n}\nvoid board_sleep(void) {\n+ uint16_t i;\n+\n+ for (i=0;i<0xf;i++);\n// not sure how to enter a sleep mode\n}\n@@ -172,14 +175,14 @@ void board_optical_calibration(void){\n//set_asc_bit(1151);\n//-------\n- // HF_CLOCK will be trimmed to 20MHz, so set RFTimer div value to 40 to get 500kHz (inverted, so 1101 0111)\n+ // HF_CLOCK will be trimmed to 20MHz, so set RFTimer div value to 122 to get 163934Hz (inverted, so 1000 0101)\nset_asc_bit(49);\n- set_asc_bit(48);\n+ clear_asc_bit(48);\nclear_asc_bit(47);\n- set_asc_bit(46);\n+ clear_asc_bit(46);\nclear_asc_bit(45);\nset_asc_bit(44);\n- set_asc_bit(43);\n+ clear_asc_bit(43);\nset_asc_bit(42);\n// Set 2M RC as source for chip CLK\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -41,10 +41,10 @@ to return the board's description.\n// this is called when require to WRITE the RFTIMER counter/compare registers,\n// where the value is going to be multiplied.\n-#define TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(value) value*61/4\n+#define TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(value) value*5\n// this is called when require to READ the RFTIMER counter/compare registers,\n// where the value is going to be divided.\n-#define TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(value) value*4/61\n+#define TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(value) value/5\n//===== radio\n@@ -55,13 +55,13 @@ to return the board's description.\n#define SLOTDURATION 20 // in miliseconds\n//// time-slot related\n-#define PORT_TsSlotDuration 655 // 491 ticks = 15ms @32768Hz\n-#define PORT_maxTxDataPrepare 100 // 66 ticks = 2013us @32768Hz\n+#define PORT_TsSlotDuration 2130 // 491 ticks = 15ms @32768Hz\n+#define PORT_maxTxDataPrepare 690 // 66 ticks = 2013us @32768Hz\n#define PORT_maxRxAckPrepare 20 // 20 ticks = 610us @32768Hz\n-#define PORT_maxRxDataPrepare 33 // 33 ticks = 1006us @32768Hz\n-#define PORT_maxTxAckPrepare 45 // 30 ticks = 915us @32768Hz\n+#define PORT_maxRxDataPrepare 528 // 33 ticks = 1006us @32768Hz\n+#define PORT_maxTxAckPrepare 48 // 30 ticks = 915us @32768Hz\n// radio speed related\n-#define PORT_delayTx 20 // 5 ticks = 152us @32768hz\n+#define PORT_delayTx 13 // 5 ticks = 152us @32768hz\n#define PORT_delayRx 0 // 0us (can not measure)\n//===== adaptive_sync accuracy\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. use a roughly 163KHz RFTimer clock.
|
491,595 |
24.04.2019 19:54:53
| -7,200 |
674565ecc78ddbf8e871cbe4c6eef3727c0be4eb
|
revert the changes of bsp_radio project.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_radio/01bsp_radio.c",
"new_path": "projects/scum/01bsp_radio/01bsp_radio.c",
"diff": "@@ -26,8 +26,8 @@ end of frame event), it will turn on its error LED.\n#define LENGTH_PACKET 125+LENGTH_CRC ///< maximum length is 127 bytes\n#define CHANNEL 11 ///< 11=2.405GHz\n-#define TIMER_PERIOD 0xfff ///< 0xffff = 2s@32kHz\n-#define ID 0x66 ///< byte sent in the packets\n+#define TIMER_PERIOD 0xffff ///< 0xffff = 2s@32kHz\n+#define ID 0x99 ///< byte sent in the packets\n//=========================== variables =======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. revert the changes of bsp_radio project.
|
491,595 |
26.04.2019 23:34:08
| -7,200 |
0bb7ee0e89730d151a901de957fa15f658d86052
|
adapt the txFrequency manually.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scm3_hardware_interface.c",
"new_path": "bsp/boards/scum/scm3_hardware_interface.c",
"diff": "@@ -158,7 +158,7 @@ void LC_FREQCHANGE_ASC(int coarse, int mid, int fine){\n}\n-void LC_monotonic_ASC(int LC_code){\n+void LC_monotonic_ASC(int LC_code, unsigned int type){\n//int coarse_divs = 440;\n//int mid_divs = 31; // For full fine code sweeps\n@@ -184,9 +184,14 @@ void LC_monotonic_ASC(int LC_code){\nfine = (((LC_code % mid_divs + fine_fix) & 0x000000FF));\nif (fine > 15){fine++;};\n+ if (type==1) {\n+ mid = mid-1;\n+ fine = 5;\n+ }\n+\nLC_FREQCHANGE_ASC(coarse,mid,fine);\n- //printf(\"coarse=%d,mid=%d,fine=%d\\n\",coarse,mid,fine);\n+// printf(\"coarse=%d,mid=%d,fine=%d\\r\\n\",coarse,mid,fine);\n}\n@@ -1044,7 +1049,7 @@ unsigned int build_RX_channel_table(unsigned int channel_11_LC_code){\n//for(ii=0; ii<16; ii++){\nwhile(ii<16) {\n- LC_monotonic_ASC(RX_channel_codes[ii]);\n+ LC_monotonic_ASC(RX_channel_codes[ii],0);\nanalog_scan_chain_write_3B_fromFPGA(&ASC[0]);\nanalog_scan_chain_load_3B_fromFPGA();\n@@ -1085,9 +1090,9 @@ unsigned int build_RX_channel_table(unsigned int channel_11_LC_code){\n}\n}\n- for(ii=0; ii<16; ii++){\n- printf(\"RX ch=%d, count_LC=%d, count_targets=%d, RX_channel_codes=%d\\r\\n\",ii+11,count_LC[ii],count_targets[ii],RX_channel_codes[ii]);\n- }\n+// for(ii=0; ii<16; ii++){\n+// printf(\"RX ch=%d, count_LC=%d, count_targets=%d, RX_channel_codes=%d\\r\\n\",ii+11,count_LC[ii],count_targets[ii],RX_channel_codes[ii]);\n+// }\nreturn count_LC[0];\n}\n@@ -1111,7 +1116,7 @@ void build_TX_channel_table(unsigned int channel_11_LC_code, unsigned int count_\n//for(ii=0; ii<16; ii++){\nwhile(ii<16) {\n- LC_monotonic_ASC(TX_channel_codes[ii]);\n+ LC_monotonic_ASC(TX_channel_codes[ii],1);\nanalog_scan_chain_write_3B_fromFPGA(&ASC[0]);\nanalog_scan_chain_load_3B_fromFPGA();\n@@ -1146,9 +1151,9 @@ void build_TX_channel_table(unsigned int channel_11_LC_code, unsigned int count_\n}\n}\n- for(ii=0; ii<16; ii++){\n- printf(\"\\r\\nTX ch=%d, count_LC=%d, count_targets=%d, TX_channel_codes=%d\\r\\n\",ii+11,count_LC[ii],count_targets[ii],TX_channel_codes[ii]);\n- }\n+// for(ii=0; ii<16; ii++){\n+// printf(\"\\r\\nTX ch=%d, count_LC=%d, count_targets=%d, TX_channel_codes=%d\\r\\n\",ii+11,count_LC[ii],count_targets[ii],TX_channel_codes[ii]);\n+// }\n}\nvoid build_channel_table(unsigned int channel_11_LC_code){\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scm3_hardware_interface.h",
"new_path": "bsp/boards/scum/scm3_hardware_interface.h",
"diff": "@@ -34,7 +34,7 @@ void radio_init_rx_MF(void);\nvoid radio_init_tx(void);\nvoid set_IF_clock_frequency(int coarse, int fine, int high_range);\nvoid LC_FREQCHANGE_ASC(int coarse, int mid, int fine);\n-void LC_monotonic_ASC(int LC_code);\n+void LC_monotonic_ASC(int LC_code, unsigned int type);\nvoid radio_init_divider(unsigned int div_value);\nvoid radio_enable_LO(void);\nvoid radio_disable_all(void);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. adapt the txFrequency manually.
|
491,595 |
26.04.2019 23:35:04
| -7,200 |
0942e18d12192038eb20094ceb6baea0b9d2bc3a
|
add temporal debug pins
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/debugpins.h",
"new_path": "bsp/boards/debugpins.h",
"diff": "@@ -58,6 +58,14 @@ void debugpins_intdisabled_toggle(void);\nvoid debugpins_intdisabled_clr(void);\nvoid debugpins_intdisabled_set(void);\n+void debugpins_debug_toggle(void);\n+void debugpins_debug_clr(void);\n+void debugpins_debug_set(void);\n+\n+void debugpins_debug_y_toggle(void);\n+void debugpins_debug_y_clr(void);\n+void debugpins_debug_y_set(void);\n+\n#ifdef OPENSIM\nvoid debugpins_ka_clr(void);\nvoid debugpins_ka_set(void);\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/debugpins.c",
"new_path": "bsp/boards/scum/debugpins.c",
"diff": "@@ -93,3 +93,27 @@ void debugpins_radio_clr(void) {\nvoid debugpins_radio_set(void) {\nGPIO_REG__OUTPUT |= 0x0020;\n}\n+\n+void debugpins_debug_toggle(void) {\n+ GPIO_REG__OUTPUT ^= 0x0040;\n+}\n+\n+void debugpins_debug_clr(void) {\n+ GPIO_REG__OUTPUT &= ~0x0040;\n+}\n+\n+void debugpins_debug_set(void) {\n+ GPIO_REG__OUTPUT |= 0x0040;\n+}\n+\n+void debugpins_debug_y_toggle(void){\n+ GPIO_REG__OUTPUT ^= 0x0080;\n+}\n+\n+void debugpins_debug_y_clr(void){\n+ GPIO_REG__OUTPUT &= ~0x0080;\n+}\n+\n+void debugpins_debug_y_set(void){\n+ GPIO_REG__OUTPUT |= 0x0080;\n+}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. add temporal debug pins
|
491,595 |
26.04.2019 23:36:20
| -7,200 |
ed667487ff7fd37e41b82a049ead82596a7c96b9
|
adapt TxFrequency and only calibrate to packet with default panid
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board.c",
"new_path": "bsp/boards/scum/board.c",
"diff": "@@ -82,8 +82,8 @@ void board_init(void) {\nboard_optical_calibration();\n// measured in SwarmLab with room temperature\n- RX_channel_codes[0] = 363;\n- TX_channel_codes[0] = 417;\n+ RX_channel_codes[0] = 363; // 361-363 at Inria\n+ TX_channel_codes[0] = 417; // 415-418 at Inria\n// set priority of interrupts\n@@ -228,7 +228,7 @@ void board_optical_calibration(void){\nset_asc_bit(1114);\n// Set initial LO frequency\n- LC_monotonic_ASC(LC_code);\n+ LC_monotonic_ASC(LC_code,0);\n// Init divider settings\nradio_init_divider(2000);\n@@ -250,6 +250,7 @@ void board_optical_calibration(void){\n// the following gpio control will be set on the FPGA\n// all the 16 pins are controlled as GPO: refer to the SCuM3B final sheet\nGPO_control_FPGA(6,6,6,6);\n+// GPO_control_FPGA(6,5,10,10);\n// Program analog scan chain on FPGA\nanalog_scan_chain_write(&ASC_FPGA[0]);\n@@ -261,7 +262,7 @@ void board_optical_calibration(void){\nISER = 0x0800;\nwhile(optical_cal_finished == 0);\n- optical_cal_finished = 0;\n+ printf(\"optical_cal_finished\\r\\n\");\n}\n// Reverses (reflects) bits in a 32-bit word.\n@@ -367,11 +368,11 @@ void optical_sfd_isr(void){\n// Start finer steps\nif(count_LC > LC_target + 60){\nLC_code -= 1;\n- LC_monotonic_ASC(LC_code);\n+ LC_monotonic_ASC(LC_code,0);\n} else {\nif(count_LC < LC_target - 60){\nLC_code += 1;\n- LC_monotonic_ASC(LC_code);\n+ LC_monotonic_ASC(LC_code,0);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/radio.c",
"new_path": "bsp/boards/scum/radio.c",
"diff": "#define FILTER_WINDOWS_LEN 11\n#define FIR_COEFF_SCALE 512 // determined by FIR_coeff\n+// ==== for recognizing panid\n+\n+#define LEN_PKT_INDEX 0x00\n+#define PANID_LBYTE_PKT_INDEX 0x04\n+#define PANID_HBYTE_PKT_INDEX 0x05\n+#define DEFAULT_PANID 0xcafe\n+\n//=========================== variables =======================================\nextern unsigned int ASC[38];\n@@ -135,7 +142,7 @@ void radio_reset(void) {\nvoid setFrequencyRX(unsigned int channel){\n// Set LO code for RX channel\n- LC_monotonic_ASC(RX_channel_codes[channel-11]);\n+ LC_monotonic_ASC(RX_channel_codes[channel-11],0);\n//printf(\"chan code = %d\\n\", RX_channel_codes[channel-11]);\n@@ -166,7 +173,7 @@ void setFrequencyRX(unsigned int channel){\nvoid setFrequencyTX(unsigned int channel){\n// Set LO code for TX channel\n- LC_monotonic_ASC(TX_channel_codes[channel-11]);\n+ LC_monotonic_ASC(TX_channel_codes[channel-11],1);\n// Turn polyphase off for TX\nclear_asc_bit(971);\n@@ -370,21 +377,24 @@ void radio_calibration(void) {\nint8_t i;\nuint8_t packet_len;\n+ uint16_t panid;\nuint32_t IF_est_filtered;\nint32_t chip_rate_error_ppm;\nint32_t chip_rate_error_ppm_filtered;\nint32_t sum;\n- packet_len = radio_vars.radio_rx_buffer[0];\n+ packet_len = radio_vars.radio_rx_buffer[LEN_PKT_INDEX];\n+ panid = (uint16_t)(radio_vars.radio_rx_buffer[PANID_LBYTE_PKT_INDEX]);\n+ panid |= ((uint16_t)(radio_vars.radio_rx_buffer[PANID_HBYTE_PKT_INDEX]))<<8;\n- if( packet_len==0x0a){\n+ if( panid == DEFAULT_PANID){\n// When updating LO and IF clock frequncies, must wait long enough for the changes to propagate before changing again\n// Need to receive as many packets as there are taps in the FIR filter\nIF_freq_freshness_timeout++;\nLO_freq_freshness_timeout++;\n- printf(\"IF_estimate=%d, cdr_tau_value=%d LQI_chip_errors=%d\\r\\n\",IF_estimate,cdr_tau_value,LQI_chip_errors);\n+// printf(\"IF_estimate=%d, cdr_tau_value=%d LQI_chip_errors=%d\\r\\n\",IF_estimate,cdr_tau_value,LQI_chip_errors);\n// ==== FIR filter for cdr tau slope ====\n@@ -429,7 +439,7 @@ void radio_calibration(void) {\n}\nIF_freq_freshness_timeout = 0;\n- printf(\"chip_rate_error_ppm = %d, chip_rate_error_ppm_filtered = %d \\r\\n\", chip_rate_error_ppm, chip_rate_error_ppm_filtered);\n+// printf(\"chip_rate_error_ppm = %d, chip_rate_error_ppm_filtered = %d \\r\\n\", chip_rate_error_ppm, chip_rate_error_ppm_filtered);\n}\n// ==== FIR filter for IF estimate ====\n@@ -443,7 +453,6 @@ void radio_calibration(void) {\n// Only make adjustments when the chip error rate is <10% (this value was picked as an arbitrary choice)\n// While packets can be received at higher chip error rates, the average IF estimate tends to be less accurate\n// Estimated chip_error_rate = LQI_chip_errors/256 (assuming the packet length was at least 8 symbols)\n-// if(LQI_chip_errors < 25){\n// Shift old samples\nfor (i=FILTER_WINDOWS_LEN-2; i>=0; i--){\n@@ -459,7 +468,7 @@ void radio_calibration(void) {\n}\nIF_est_filtered = sum / FIR_COEFF_SCALE;\n- printf(\"IF_estimate = %d, IF_est_filtered = %d \\r\\n\", IF_estimate, IF_est_filtered);\n+// printf(\"IF_estimate = %d, IF_est_filtered = %d \\r\\n\", IF_estimate, IF_est_filtered);\n// The LO frequency steps are about ~80-100 kHz, so make an adjustment only if the error is larger than that\n// These hysteresis bounds (+/- X) have not been optimized\n@@ -468,18 +477,19 @@ void radio_calibration(void) {\nif(LO_freq_freshness_timeout >= LO_FREQ_UPDATE_TIMEOUT){\nif(IF_est_filtered > 520){\nRX_channel_codes[radio_vars.current_frequency - 11]++;\n- TX_channel_codes[radio_vars.current_frequency - 11]++;\n+// TX_channel_codes[radio_vars.current_frequency - 11]++;\n}\nif(IF_est_filtered < 480){\nRX_channel_codes[radio_vars.current_frequency - 11]--;\n- TX_channel_codes[radio_vars.current_frequency - 11]--;\n+// TX_channel_codes[radio_vars.current_frequency - 11]--;\n}\nLO_freq_freshness_timeout = 0;\n- printf(\"IF_estimate = %d, IF_est_filtered = %d \\r\\n\", IF_estimate, IF_est_filtered);\n+// printf(\"IF_estimate = %d, IF_est_filtered = %d \\r\\n\", IF_estimate, IF_est_filtered);\n}\n-// }\n+\n+// printf(\"RX_channel_codes[0]=%d, TX_channel_codes[0]=%d \\r\\n\",RX_channel_codes[0], TX_channel_codes[0]);\n// Write and load analog scan chain\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. adapt TxFrequency and only calibrate to packet with default panid
|
491,595 |
26.04.2019 23:37:11
| -7,200 |
b18426dc464da5ea487263e6939a8b654b6791c3
|
implement enable disable interrupt
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/sctimer.c",
"new_path": "bsp/boards/scum/sctimer.c",
"diff": "#define RFTIMER_MAX_COUNT 0x3ffffff // use a value less than 0xffffffff/61 and also equal to 2^n-1\n#define TIMERLOOP_THRESHOLD 0xfffff // 0xffff is 2 seconds @ 32768Hz clock\n-#define MINIMUM_COMPAREVALE_ADVANCE 10\n+#define MINIMUM_COMPAREVALE_ADVANCE 5\n// ========================== variable ========================================\n@@ -95,10 +95,12 @@ void sctimer_enable(void){\n// enable compare interrupt (this also cancels any pending interrupts)\nRFTIMER_REG__COMPARE0_CONTROL = RFTIMER_COMPARE_ENABLE | \\\nRFTIMER_COMPARE_INTERRUPT_ENABLE;\n+ ISER = 0x80;\n}\nvoid sctimer_disable(void){\nRFTIMER_REG__COMPARE0_CONTROL = 0x0;\n+ ICER = 0x80;\n}\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. implement enable disable interrupt
|
491,595 |
26.04.2019 23:38:03
| -7,200 |
131fbd0d4dceb6818e8c39ea1a360a9c7ae8ea3d
|
adapt timing for SCuM.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -52,14 +52,14 @@ to return the board's description.\n//===== IEEE802154E timing\n-#define SLOTDURATION 20 // in miliseconds\n+#define SLOTDURATION 70 // in miliseconds\n//// time-slot related\n-#define PORT_TsSlotDuration 2130 // 491 ticks = 15ms @32768Hz\n+#define PORT_TsSlotDuration 2296 // 491 ticks = 15ms @32768Hz\n#define PORT_maxTxDataPrepare 690 // 66 ticks = 2013us @32768Hz\n-#define PORT_maxRxAckPrepare 20 // 20 ticks = 610us @32768Hz\n+#define PORT_maxRxAckPrepare 512 // 20 ticks = 610us @32768Hz\n#define PORT_maxRxDataPrepare 528 // 33 ticks = 1006us @32768Hz\n-#define PORT_maxTxAckPrepare 48 // 30 ticks = 915us @32768Hz\n+#define PORT_maxTxAckPrepare 504 // 30 ticks = 915us @32768Hz\n// radio speed related\n#define PORT_delayTx 13 // 5 ticks = 152us @32768hz\n#define PORT_delayRx 0 // 0us (can not measure)\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -278,6 +278,18 @@ This function executes in ISR mode, when the new slot timer fires.\nvoid isr_ieee154e_newSlot(opentimers_id_t id) {\nieee154e_vars.startOfSlotReference = opentimers_getCurrentCompareValue();\n+\n+ if (ieee154e_vars.compensatingCounter == 0 && idmanager_getIsDAGroot()==FALSE){\n+ opentimers_scheduleAbsolute(\n+ ieee154e_vars.timerId, // timerId\n+ TsSlotDuration+1, // duration\n+ ieee154e_vars.startOfSlotReference, // reference\n+ TIME_TICS, // timetype\n+ isr_ieee154e_newSlot // callback\n+ );\n+ ieee154e_vars.compensatingCounter = 7;\n+ ieee154e_vars.slotDuration = TsSlotDuration+1;\n+ } else {\nopentimers_scheduleAbsolute(\nieee154e_vars.timerId, // timerId\nTsSlotDuration, // duration\n@@ -286,6 +298,18 @@ void isr_ieee154e_newSlot(opentimers_id_t id) {\nisr_ieee154e_newSlot // callback\n);\nieee154e_vars.slotDuration = TsSlotDuration;\n+ }\n+\n+ ieee154e_vars.compensatingCounter -= 1;\n+\n+// opentimers_scheduleAbsolute(\n+// ieee154e_vars.timerId, // timerId\n+// TsSlotDuration, // duration\n+// ieee154e_vars.startOfSlotReference, // reference\n+// TIME_TICS, // timetype\n+// isr_ieee154e_newSlot // callback\n+// );\n+// ieee154e_vars.slotDuration = TsSlotDuration;\n// radiotimer_setPeriod(ieee154e_vars.slotDuration);\nif (ieee154e_vars.isSync==FALSE) {\nif (idmanager_getIsDAGroot()==TRUE) {\n@@ -563,7 +587,7 @@ port_INLINE void activity_synchronize_newSlot(void) {\nieee154e_vars.freq = (openrandom_get16b()&0x0F) + 11;\n// configure the radio to listen to the frequency\n- radio_setFrequency(ieee154e_vars.freq);\n+ radio_setFrequency(ieee154e_vars.freq, 0x02);\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\nsctimer_setCapture(ACTION_RX_SFD_DONE);\n@@ -591,7 +615,7 @@ port_INLINE void activity_synchronize_newSlot(void) {\nieee154e_vars.freq = (openrandom_get16b()&0x0F) + 11;\n// configure the radio to listen to the frequency\n- radio_setFrequency(ieee154e_vars.freq);\n+ radio_setFrequency(ieee154e_vars.freq, 0x02);\n}\n// switch on the radio in Rx mode.\n@@ -610,7 +634,7 @@ port_INLINE void activity_synchronize_newSlot(void) {\nieee154e_vars.freq = calculateFrequency(ieee154e_vars.singleChannel);\n// configure the radio to listen to the default synchronizing channel\n- radio_setFrequency(ieee154e_vars.freq);\n+ radio_setFrequency(ieee154e_vars.freq, 0x02);\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\nsctimer_setCapture(ACTION_RX_SFD_DONE);\n@@ -675,7 +699,7 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\n// change state\nchangeState(S_SYNCPROC);\n-\n+ debugpins_debug_set();\n// get a buffer to put the (received) frame in\nieee154e_vars.dataReceived = openqueue_getFreePacketBuffer(COMPONENT_IEEE802154E);\nif (ieee154e_vars.dataReceived==NULL) {\n@@ -691,6 +715,8 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\nieee154e_vars.dataReceived->creator = COMPONENT_IEEE802154E;\nieee154e_vars.dataReceived->owner = COMPONENT_IEEE802154E;\n+ debugpins_debug_clr();\n+\n/*\nThe do-while loop that follows is a little parsing trick.\nBecause it contains a while(0) condition, it gets executed only once.\n@@ -702,7 +728,7 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\ndoes not get executed. This indicates the received packet is correct.\n*/\ndo { // this \"loop\" is only executed once\n-\n+ debugpins_debug_set();\n// retrieve the received data frame from the radio's Rx buffer\nieee154e_vars.dataReceived->payload = &(ieee154e_vars.dataReceived->packet[FIRST_FRAME_BYTE]);\nradio_getReceivedFrame( ieee154e_vars.dataReceived->payload,\n@@ -711,6 +737,7 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\n&ieee154e_vars.dataReceived->l1_rssi,\n&ieee154e_vars.dataReceived->l1_lqi,\n&ieee154e_vars.dataReceived->l1_crc);\n+ debugpins_debug_clr();\n// break if packet too short\nif (ieee154e_vars.dataReceived->length<LENGTH_CRC || ieee154e_vars.dataReceived->length>LENGTH_IEEE154_MAX) {\n@@ -730,6 +757,8 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\nbreak;\n}\n+ debugpins_debug_set();\n+\n// parse the IEEE802.15.4 header (synchronize, end of frame)\nieee802154_retrieveHeader(ieee154e_vars.dataReceived,&ieee802514_header);\n@@ -744,6 +773,8 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\nieee154e_vars.dataReceived->l2_dsn = ieee802514_header.dsn;\nmemcpy(&(ieee154e_vars.dataReceived->l2_nextORpreviousHop),&(ieee802514_header.src),sizeof(open_addr_t));\n+ debugpins_debug_clr();\n+\n// verify that incoming security level is acceptable\nif (IEEE802154_security_acceptableLevel(ieee154e_vars.dataReceived, &ieee802514_header) == FALSE) {\nbreak;\n@@ -761,6 +792,8 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\n}\n}\n+ debugpins_debug_set();\n+\n// toss the IEEE802.15.4 header -- this does not include IEs as they are processed\n// next.\npacketfunctions_tossHeader(ieee154e_vars.dataReceived,ieee802514_header.headerLength);\n@@ -779,6 +812,10 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\nbreak;\n}\n+ debugpins_debug_clr();\n+\n+ debugpins_debug_set();\n+\n// turn off the radio\nradio_rfOff();\n@@ -791,6 +828,8 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime)\n// synchronize (for the first time) to the sender's EB\nsynchronizePacket(ieee154e_vars.syncCapturedTime);\n+ debugpins_debug_clr();\n+\n// declare synchronized\nchangeIsSync(TRUE);\n// log the info\n@@ -946,7 +985,6 @@ port_INLINE void activity_ti1ORri1(void) {\n// abort the slot\nendSlot();\n-\nreturn;\n}\n@@ -1010,6 +1048,16 @@ port_INLINE void activity_ti1ORri1(void) {\nif (ieee154e_vars.dataToSend == NULL) {\nieee154e_vars.dataToSend = openqueue_macGet6PResponseAndDownStreamPacket(&neighbor);\n}\n+\n+ if (ieee154e_vars.dataToSend != NULL) {\n+ printf(\"creator=%d reqORresp=%d neighborType=%d neighbor_addr[6]=%x neighbor_addr[7]=%x\\r\\n\",\n+ ieee154e_vars.dataToSend->creator,\n+ ieee154e_vars.dataToSend->l2_sixtop_command,\n+ autonomousUnicastNeighbor.type,\n+ autonomousUnicastNeighbor.addr_64b[6],\n+ autonomousUnicastNeighbor.addr_64b[7]\n+ );\n+ }\n}\n}\n}\n@@ -1023,6 +1071,9 @@ port_INLINE void activity_ti1ORri1(void) {\n} else {\n// change state\nchangeState(S_TXDATAOFFSET);\n+\n+\n+ debugpins_debug_y_toggle();\n// change owner\nieee154e_vars.dataToSend->owner = COMPONENT_IEEE802154E;\nif (couldSendEB==TRUE) { // I will be sending an EB\n@@ -1033,6 +1084,7 @@ port_INLINE void activity_ti1ORri1(void) {\nmemcpy(ieee154e_vars.dataToSend->l2_ASNpayload,&asn[0],sizeof(asn_t));\nmemcpy(ieee154e_vars.dataToSend->l2_ASNpayload+sizeof(asn_t),&join_priority,sizeof(uint8_t));\n}\n+ debugpins_debug_y_toggle();\n// record that I attempt to transmit this packet\nieee154e_vars.dataToSend->l2_numTxAttempts++;\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n@@ -1068,6 +1120,7 @@ port_INLINE void activity_ti1ORri1(void) {\nsctimer_setCapture(ACTION_TX_SFD_DONE);\nsctimer_setCapture(ACTION_TX_SEND_DONE);\n#else\n+ debugpins_debug_y_toggle();\n// arm tt1\nopentimers_scheduleAbsolute(\nieee154e_vars.timerId, // timerId\n@@ -1076,6 +1129,7 @@ port_INLINE void activity_ti1ORri1(void) {\nTIME_TICS, // timetype\nisr_ieee154e_timer // callback\n);\n+ debugpins_debug_y_toggle();\n// radiotimer_schedule(DURATION_tt1);\n#endif\nbreak;\n@@ -1153,7 +1207,7 @@ port_INLINE void activity_ti2(void) {\npacketfunctions_reserveFooterSize(&ieee154e_vars.localCopyForTransmission, 2);\n// configure the radio for that frequency\n- radio_setFrequency(ieee154e_vars.freq);\n+ radio_setFrequency(ieee154e_vars.freq, 0x01);\n// load the packet in the radio's Tx buffer\nradio_loadPacket(ieee154e_vars.localCopyForTransmission.payload,\n@@ -1320,6 +1374,7 @@ port_INLINE void activity_ti5(PORT_TIMER_WIDTH capturedTime) {\nnotif_sendDone(ieee154e_vars.dataToSend,E_SUCCESS);\n// reset local variable\nieee154e_vars.dataToSend = NULL;\n+\n// abort\nendSlot();\n}\n@@ -1343,7 +1398,7 @@ port_INLINE void activity_ti6(void) {\n// radiotimer_schedule(DURATION_tt6);\n// configure the radio for that frequency\n- radio_setFrequency(ieee154e_vars.freq);\n+ radio_setFrequency(ieee154e_vars.freq, 0x02);\nradio_rxEnable();\n#endif\n@@ -1619,7 +1674,7 @@ port_INLINE void activity_ri2(void) {\n// radiotimer_schedule(DURATION_rt2);\n// configure the radio for that frequency\n- radio_setFrequency(ieee154e_vars.freq);\n+ radio_setFrequency(ieee154e_vars.freq, 0x02);\nradio_rxEnable();\n#endif\n@@ -1768,6 +1823,7 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) {\n*/\ndo { // this \"loop\" is only executed once\n+ debugpins_debug_toggle();\n// retrieve the received data frame from the radio's Rx buffer\nieee154e_vars.dataReceived->payload = &(ieee154e_vars.dataReceived->packet[FIRST_FRAME_BYTE]);\nradio_getReceivedFrame(\n@@ -1806,6 +1862,8 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) {\nbreak;\n}\n+ debugpins_debug_toggle();\n+\n// store header details in packet buffer\nieee154e_vars.dataReceived->l2_frameType = ieee802514_header.frameType;\nieee154e_vars.dataReceived->l2_dsn = ieee802514_header.dsn;\n@@ -1858,6 +1916,8 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) {\nbreak;\n}\n+ debugpins_debug_toggle();\n+\n// record the timeCorrection and print out at end of slot\nieee154e_vars.dataReceived->l2_timeCorrection = (PORT_SIGNED_INT_WIDTH)((PORT_SIGNED_INT_WIDTH)TsTxOffset-(PORT_SIGNED_INT_WIDTH)ieee154e_vars.syncCapturedTime);\n@@ -1946,6 +2006,9 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) {\n// synchronize to the received packet if I'm not a DAGroot and this is my preferred parent\n// or in case I'm in the middle of the join process when parent is not yet selected\n// or in case I don't have an autonomous Tx cell cell to my parent yet\n+\n+ debugpins_debug_toggle();\n+\nif (\nidmanager_getIsDAGroot() == FALSE &&\n(\n@@ -1966,6 +2029,7 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) {\nieee154e_vars.dataReceived = NULL;\n// abort\nendSlot();\n+ leds_debug_off();\n}\n// everything went well, return here not to execute the error code below\n@@ -1981,6 +2045,7 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) {\n// abort\nendSlot();\n+ leds_debug_off();\n}\nport_INLINE void activity_ri6(void) {\n@@ -2050,8 +2115,10 @@ port_INLINE void activity_ri6(void) {\n}\n// space for 2-byte CRC\npacketfunctions_reserveFooterSize(ieee154e_vars.ackToSend,2);\n+\n+ radio_rfOff();\n// configure the radio for that frequency\n- radio_setFrequency(ieee154e_vars.freq);\n+ radio_setFrequency(ieee154e_vars.freq, 0x01);\n// load the packet in the radio's Tx buffer\nradio_loadPacket(ieee154e_vars.ackToSend->payload,\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -42,9 +42,9 @@ static const uint8_t ebIEsBytestream[] = {\n#define TX_POWER 31 // 1=-25dBm, 31=0dBm (max value)\n#define RESYNCHRONIZATIONGUARD 5 // in 32kHz ticks. min distance to the end of the slot to successfully synchronize\n#define US_PER_TICK 30 // number of us per 32kHz clock tick\n-#define EB_PORTION 10 // set EB on minimal cell for 1/EB_PORTION portion\n-#define MAXKAPERIOD 1000 // in slots: 1500@20ms per slot -> ~30 seconds. Max value used by adaptive synchronization.\n-#define DESYNCTIMEOUT 1750 // in slots: 1750@20ms per slot -> ~35 seconds. A larger DESYNCTIMEOUT is needed if using a larger KATIMEOUT.\n+#define EB_PORTION 2 // set EB on minimal cell for 1/EB_PORTION portion\n+#define MAXKAPERIOD 428 // in slots: 1500@20ms per slot -> ~30 seconds. Max value used by adaptive synchronization.\n+#define DESYNCTIMEOUT 500 // in slots: 1750@20ms per slot -> ~35 seconds. A larger DESYNCTIMEOUT is needed if using a larger KATIMEOUT.\n#define LIMITLARGETIMECORRECTION 5 // threshold number of ticks to declare a timeCorrection \"large\"\n#define LENGTH_IEEE154_MAX 128 // max length of a valid radio packet\n#define DUTY_CYCLE_WINDOW_LIMIT (0xFFFFFFFF>>1) // limit of the dutycycle window\n@@ -165,11 +165,11 @@ enum ieee154e_atomicdurations_enum {\nTsTxAckDelay = 33, // 1000us\nTsShortGT = 13, // 500us, The standardlized value for this is 400/2=200us(7ticks). Currectly 7 doesn't work for short packet, change it back to 7 when found the problem.\n#endif\n-#if SLOTDURATION==20\n- TsTxOffset = 171, // 5215us\n- TsLongGT = 43, // 1300us\n- TsTxAckDelay = 181, // 5521us\n- TsShortGT = 16, // 500us\n+#if SLOTDURATION==70\n+ TsTxOffset = 800, // 5215us\n+ TsLongGT = 44, // 1300us\n+ TsTxAckDelay = 1100, // 5521us\n+ TsShortGT = 30, // 500us\n#endif\nTsSlotDuration = PORT_TsSlotDuration, // 10000us\n// execution speed related\n@@ -181,7 +181,7 @@ enum ieee154e_atomicdurations_enum {\ndelayTx = PORT_delayTx, // between GO signal and SFD\ndelayRx = PORT_delayRx, // between GO signal and start listening\n// radio watchdog\n- wdRadioTx = 45, // 1000us (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works)\n+ wdRadioTx = 44, // 1000us (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works)\nwdDataDuration = 164, // 5000us (measured 4280us with max payload)\nwdAckDuration = 98, // 3000us (measured 1000us)\n};\n@@ -214,7 +214,7 @@ enum ieee154e_linkOption_enum {\n#define DURATION_rt7 ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx+wdRadioTx\n#define DURATION_rt8 ieee154e_vars.lastCapturedTime+wdAckDuration\n// serialInhibit\n-#define DURATION_si ieee154e_vars.slotDuration-SERIALINHIBITGUARD\n+#define DURATION_si ieee154e_vars.slotDuration-3*SERIALINHIBITGUARD\n//=========================== typedef =========================================\n@@ -266,6 +266,7 @@ typedef struct {\nopentimers_id_t timerId; // id of timer used for implementing TSCH slot FSM\nuint32_t startOfSlotReference; // the time refer to the beginning of slot\nopentimers_id_t serialInhibitTimerId; // id of serial inhibit timer used for scheduling serial output\n+ uint16_t compensatingCounter;\n} ieee154e_vars_t;\nBEGIN_PACK\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. adapt timing for SCuM.
|
491,595 |
26.04.2019 23:39:21
| -7,200 |
3e910550efbb24d3cbd269889d6e546ab2272883
|
send txNow command with a timer interrupt.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_radio/01bsp_radio.c",
"new_path": "projects/scum/01bsp_radio/01bsp_radio.c",
"diff": "@@ -26,8 +26,8 @@ end of frame event), it will turn on its error LED.\n#define LENGTH_PACKET 125+LENGTH_CRC ///< maximum length is 127 bytes\n#define CHANNEL 11 ///< 11=2.405GHz\n-#define TIMER_PERIOD 0xffff ///< 0xffff = 2s@32kHz\n-#define ID 0x99 ///< byte sent in the packets\n+#define TIMER_PERIOD 0xfff ///< 0xffff = 2s@32kHz\n+#define ID 0x12 ///< byte sent in the packets\n//=========================== variables =======================================\n@@ -58,6 +58,7 @@ typedef struct {\nint8_t rxpk_rssi;\nuint8_t rxpk_lqi;\nbool rxpk_crc;\n+ bool txFlag;\n} app_vars_t;\napp_vars_t app_vars;\n@@ -75,6 +76,7 @@ void cb_timer(void);\n*/\nint mote_main(void) {\nuint8_t i;\n+ uint32_t j;\n// clear local variables\nmemset(&app_vars,0,sizeof(app_vars_t));\n@@ -168,6 +170,9 @@ int mote_main(void) {\n// led\nleds_error_off();\n+// if (app_vars.packet_len==22) {\n+// app_vars.flags |= APP_FLAG_TIMER;\n+// }\nbreak;\ncase APP_STATE_TX:\n// done sending a packet\n@@ -204,10 +209,10 @@ int mote_main(void) {\nradio_setFrequency(CHANNEL, APP_STATE_TX);\n// start transmitting packet\n- radio_loadPacket(app_vars.packet,app_vars.packet_len);\n+ radio_loadPacket(app_vars.packet,125);\nradio_txEnable();\n- radio_txNow();\n-\n+ app_vars.txFlag = TRUE;\n+ sctimer_setCompare(sctimer_readCounter()+10);\napp_vars.state = APP_STATE_TX;\n// clear flag\n@@ -237,10 +242,16 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\nvoid cb_timer(void) {\n// set flag\n+ if (app_vars.txFlag==FALSE) {\napp_vars.flags |= APP_FLAG_TIMER;\n+ sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);\n+ } else {\n+ app_vars.txFlag = FALSE;\n+ radio_txNow();\n+ sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);\n+ }\n// update debug stats\napp_dbg.num_timer++;\n- sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. send txNow command with a timer interrupt.
|
491,595 |
26.04.2019 23:40:16
| -7,200 |
21a16354a8d32026ede5b0084bb1f404cdd6f152
|
update oos_openwsn project file.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/scum/03oos_openwsn/03oos_openwsn.uvprojx",
"new_path": "projects/scum/03oos_openwsn/03oos_openwsn.uvprojx",
"diff": "<MiscControls>--gnu</MiscControls>\n<Define></Define>\n<Undefine></Undefine>\n- <IncludePath>..\\..\\..\\bsp\\boards;..\\..\\..\\bsp\\boards\\scum;..\\..\\..\\drivers\\common;..\\..\\..\\inc;..\\..\\..\\openstack\\02a-MAClow;..\\..\\..\\openstack\\02b-MAChigh;..\\..\\..\\openstack\\03a-IPHC;..\\..\\..\\openstack\\03b-IPv6;..\\..\\..\\openstack\\04-TRAN;..\\..\\..\\openstack\\cross-layers;..\\..\\..\\kernel;..\\..\\..\\openapps;..\\..\\..\\openstack;..\\..\\..\\bsp\\boards\\common;..\\..\\..\\openapps\\c6t;..\\..\\..\\openapps\\uinject;..\\..\\..\\openapps\\techo;..\\..\\..\\openapps\\uecho;..\\..\\..\\openapps\\cinfo;..\\..\\..\\openapps\\cleds;..\\..\\..\\openapps\\rrt;..\\..\\..\\openapps\\cexample;..\\..\\..\\openapps\\cstorm;..\\..\\..\\openapps\\cwellknown;..\\..\\..\\openapps\\userialbridge;..\\..\\..\\openapps\\opencoap;..\\..\\..\\openapps\\cjoin;..\\..\\..\\openapps\\uexpiration;..\\..\\..\\openapps\\uexpiration_monitor</IncludePath>\n+ <IncludePath>..\\..\\..\\bsp\\boards\\scum;..\\..\\..\\bsp\\boards;..\\..\\..\\drivers\\common;..\\..\\..\\inc;..\\..\\..\\openstack\\02a-MAClow;..\\..\\..\\openstack\\02b-MAChigh;..\\..\\..\\openstack\\03a-IPHC;..\\..\\..\\openstack\\03b-IPv6;..\\..\\..\\openstack\\04-TRAN;..\\..\\..\\openstack\\cross-layers;..\\..\\..\\kernel;..\\..\\..\\openstack;..\\..\\..\\bsp\\boards\\common</IncludePath>\n</VariousControls>\n</Cads>\n<Aads>\n<FileType>5</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\leds.h</FilePath>\n</File>\n- <File>\n- <FileName>radio.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\bsp\\boards\\radio.h</FilePath>\n- </File>\n<File>\n<FileName>uart.h</FileName>\n<FileType>5</FileType>\n<FileType>1</FileType>\n<FilePath>..\\..\\..\\bsp\\boards\\scum\\cryptoengine.c</FilePath>\n</File>\n+ <File>\n+ <FileName>bucket_o_functions.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\bucket_o_functions.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>bucket_o_functions.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\bucket_o_functions.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>retarget.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\retarget.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>radio.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\radio.h</FilePath>\n+ </File>\n</Files>\n</Group>\n<Group>\n</File>\n</Files>\n</Group>\n- <Group>\n- <GroupName>openapps</GroupName>\n- <Files>\n- <File>\n- <FileName>openapps.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\openapps.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>c6t</GroupName>\n- <Files>\n- <File>\n- <FileName>c6t.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\c6t\\c6t.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>uinject</GroupName>\n- <Files>\n- <File>\n- <FileName>uinject.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\uinject\\uinject.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>cinfo</GroupName>\n- <Files>\n- <File>\n- <FileName>cinfo.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\cinfo\\cinfo.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>uecho</GroupName>\n- <Files>\n- <File>\n- <FileName>uecho.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\uecho\\uecho.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>cstorm</GroupName>\n- <Files>\n- <File>\n- <FileName>cstorm.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\cstorm\\cstorm.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>rrt</GroupName>\n- <Files>\n- <File>\n- <FileName>rrt.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\rrt\\rrt.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>cwellknown</GroupName>\n- <Files>\n- <File>\n- <FileName>cwellknown.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\cwellknown\\cwellknown.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>userialbridge</GroupName>\n- <Files>\n- <File>\n- <FileName>userialbridge.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\userialbridge\\userialbridge.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>cleds</GroupName>\n- <Files>\n- <File>\n- <FileName>cleds.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\cleds\\cleds.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>opencoap</GroupName>\n- <Files>\n- <File>\n- <FileName>cborencoder.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\cborencoder.c</FilePath>\n- </File>\n- <File>\n- <FileName>cborencoder.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\cborencoder.h</FilePath>\n- </File>\n- <File>\n- <FileName>hkdf.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\hkdf.c</FilePath>\n- </File>\n- <File>\n- <FileName>hmac.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\hmac.c</FilePath>\n- </File>\n- <File>\n- <FileName>opencoap.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\opencoap.c</FilePath>\n- </File>\n- <File>\n- <FileName>opencoap.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\opencoap.h</FilePath>\n- </File>\n- <File>\n- <FileName>openoscoap.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\openoscoap.c</FilePath>\n- </File>\n- <File>\n- <FileName>openoscoap.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\openoscoap.h</FilePath>\n- </File>\n- <File>\n- <FileName>sha.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\sha.h</FilePath>\n- </File>\n- <File>\n- <FileName>sha224-256.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\sha224-256.c</FilePath>\n- </File>\n- <File>\n- <FileName>sha-private.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\sha-private.h</FilePath>\n- </File>\n- <File>\n- <FileName>usha.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\opencoap\\usha.c</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>uexpiration</GroupName>\n- <Files>\n- <File>\n- <FileName>uexpiration.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\uexpiration\\uexpiration.c</FilePath>\n- </File>\n- <File>\n- <FileName>uexpiration.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\openapps\\uexpiration\\uexpiration.h</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>uexpiration_monitor</GroupName>\n- <Files>\n- <File>\n- <FileName>uexpiration_monitor.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\uexpiration_monitor\\uexpiration_monitor.c</FilePath>\n- </File>\n- <File>\n- <FileName>uexpiration_monitor.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\openapps\\uexpiration_monitor\\uexpiration_monitor.h</FilePath>\n- </File>\n- </Files>\n- </Group>\n- <Group>\n- <GroupName>cjoin</GroupName>\n- <Files>\n- <File>\n- <FileName>cjoin.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\cjoin\\cjoin.c</FilePath>\n- </File>\n- <File>\n- <FileName>cjoin.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\openapps\\cjoin\\cjoin.h</FilePath>\n- </File>\n- <File>\n- <FileName>cojp_cbor.c</FileName>\n- <FileType>1</FileType>\n- <FilePath>..\\..\\..\\openapps\\cjoin\\cojp_cbor.c</FilePath>\n- </File>\n- <File>\n- <FileName>cojp_cbor.h</FileName>\n- <FileType>5</FileType>\n- <FilePath>..\\..\\..\\openapps\\cjoin\\cojp_cbor.h</FilePath>\n- </File>\n- </Files>\n- </Group>\n</Groups>\n</Target>\n</Targets>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. update oos_openwsn project file.
|
491,595 |
26.04.2019 23:41:04
| -7,200 |
3bdec255104915988888d11ff6f59e3d02323aa3
|
adapt stack to SCuM.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "#include \"sixtop.h\"\n#include \"scheduler.h\"\n#include \"schedule.h\"\n-#include \"openapps.h\"\n#include \"openrandom.h\"\n#include \"idmanager.h\"\n#include \"icmpv6rpl.h\"\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -654,8 +654,7 @@ bool schedule_getAutonomousTxRxCellUnicastNeighbor(open_addr_t* neighbor){\nif(\nschedule_vars.scheduleBuf[i].type == CELLTYPE_TXRX &&\nschedule_vars.scheduleBuf[i].shared &&\n- schedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\n- packetfunctions_sameAddress(neighbor,&schedule_vars.scheduleBuf[i].neighbor)\n+ schedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B\n){\nmemcpy(neighbor, &schedule_vars.scheduleBuf[i].neighbor, sizeof(open_addr_t));\nENABLE_INTERRUPTS();\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "The superframe reappears over time and can be arbitrarily long.\n*/\n-#define SLOTFRAME_LENGTH 101 //should be 101\n+#define SLOTFRAME_LENGTH 11 //should be 101\n//draft-ietf-6tisch-minimal-06\n#define SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS 1\n@@ -37,7 +37,7 @@ The superframe reappears over time and can be arbitrarily long.\nfor serial port to transmit data to dagroot.\n*/\n-#define NUMSLOTSOFF 20\n+#define NUMSLOTSOFF 5\n/**\n\\brief Maximum number of active slots in a superframe.\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -728,7 +728,7 @@ port_INLINE void sixtop_sendEB(void) {\nif (\n(ieee154e_isSynch()==FALSE) ||\n- (IEEE802154_security_isConfigured()==FALSE) ||\n+// (IEEE802154_security_isConfigured()==FALSE) ||\n(icmpv6rpl_getMyDAGrank()==DEFAULTDAGRANK) ||\nicmpv6rpl_daoSent()==FALSE\n) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/04-TRAN/openudp.c",
"new_path": "openstack/04-TRAN/openudp.c",
"diff": "#include \"packetfunctions.h\"\n#include \"forwarding.h\"\n#include \"openqueue.h\"\n-// applications\n-#include \"opencoap.h\"\n-#include \"uecho.h\"\n-#include \"uinject.h\"\n-#include \"userialbridge.h\"\n-#include \"rrt.h\"\n//=========================== variables =======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/openstack.c",
"new_path": "openstack/openstack.c",
"diff": "#include \"icmpv6rpl.h\"\n//-- 04-TRAN\n#include \"openudp.h\"\n-//===== applications\n-#include \"openapps.h\"\n//=========================== variables =======================================\n@@ -74,9 +72,6 @@ void openstack_init(void) {\n//-- 04-TRAN\nopenudp_init();\n- //===== applications\n- openapps_init();\n-\nopenserial_printInfo(\nCOMPONENT_OPENWSN,ERR_BOOTED,\n(errorparameter_t)0,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. adapt stack to SCuM.
|
491,595 |
02.05.2019 10:43:34
| -7,200 |
2d44fdc1d6ac4fcba181593e53a9d0302f037378
|
add RFCONTROLE error flags.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/memory_map.h",
"new_path": "bsp/boards/scum/memory_map.h",
"diff": "#define RX_SFD_DONE_INT 0x08\n#define RX_DONE_INT 0x10\n+// ==== RFCONTROLLER error flag\n+\n+#define TX_OVERFLOW_ERROR 0x01\n+#define TX_CUTOFF_ERROR 0x02\n+#define RX_OVERFLOW_ERROR 0x04\n+#define RX_CRC_ERROR 0x08\n+#define RX_CUTOFF_ERROR 0x10\n+\n// ========================== RFTIMER Registers ===============================\n#define RFTIMER_REG__CONTROL *(unsigned int*)(AHB_RFTIMER_BASE + 0x00)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. add RFCONTROLE error flags.
|
491,595 |
02.05.2019 10:45:33
| -7,200 |
be41ac16ea5c882e2ccb64ab54308bffb414ae96
|
check the crc and only calibrate when crc is correct.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/radio.c",
"new_path": "bsp/boards/scum/radio.c",
"diff": "@@ -52,6 +52,7 @@ typedef struct {\nuint8_t radio_rx_buffer[MAXLENGTH_TRX_BUFFER] __attribute__ ((aligned (4)));\nradio_state_t state;\nuint8_t current_frequency;\n+ bool crc_ok;\n} radio_vars_t;\nradio_vars_t radio_vars;\n@@ -357,7 +358,7 @@ void radio_getReceivedFrame(uint8_t* pBufRead,\nbool* pCrc) {\n//===== crc\n- *pCrc = DEFAULT_CRC_CHECK;\n+ *pCrc = radio_vars.crc_ok;\n//===== rssi\n*pRssi = DEFAULT_RSSI;\n@@ -387,7 +388,7 @@ void radio_calibration(void) {\npanid = (uint16_t)(radio_vars.radio_rx_buffer[PANID_LBYTE_PKT_INDEX]);\npanid |= ((uint16_t)(radio_vars.radio_rx_buffer[PANID_HBYTE_PKT_INDEX]))<<8;\n- if( panid == DEFAULT_PANID){\n+ if( radio_vars.crc_ok){\n// When updating LO and IF clock frequncies, must wait long enough for the changes to propagate before changing again\n// Need to receive as many packets as there are taps in the FIR filter\n@@ -562,6 +563,8 @@ kick_scheduler_t radio_isr(void) {\n#endif\nRFCONTROLLER_REG__INT_CLEAR = RX_DONE_INT;\n+ // record calibration related value\n+\n// Only record IF estimate, LQI, and CDR tau for valid packets\nIF_estimate = read_IF_estimate();\nLQI_chip_errors = ANALOG_CFG_REG__21 & 0xFF; //read_LQI();\n@@ -570,6 +573,14 @@ kick_scheduler_t radio_isr(void) {\n// Do this later in the ISR to make sure this register has settled before trying to read it\n// (the register is on the adc clock domain)\ncdr_tau_value = ANALOG_CFG_REG__25;\n+\n+ // check crc\n+\n+ if (irq_error & RX_CRC_ERROR) {\n+ radio_vars.crc_ok = FALSE;\n+ } else {\n+ radio_vars.crc_ok = TRUE;\n+ }\n}\n// the packet transmission or reception is done,\n// update the radio state\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. check the crc and only calibrate when crc is correct.
|
491,595 |
02.05.2019 10:46:22
| -7,200 |
b27b5bdebf99093471c6b9e126314378d1f78178
|
hard cord rx frequency as well.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scm3_hardware_interface.c",
"new_path": "bsp/boards/scum/scm3_hardware_interface.c",
"diff": "@@ -185,8 +185,13 @@ void LC_monotonic_ASC(int LC_code, unsigned int type){\nif (fine > 15){fine++;};\nif (type==1) {\n+ // need to be tuned each time for now (fine ranges from (0-11))\nmid = mid-1;\n- fine = 5;\n+ fine = 0;\n+ } else {\n+ printf(\"coarse=%d,mid=%d,fine=%d\\r\\n\",coarse,mid,fine);\n+// mid = mid-1;\n+ fine = 0;\n}\nLC_FREQCHANGE_ASC(coarse,mid,fine);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. hard cord rx frequency as well.
|
491,595 |
02.05.2019 10:48:02
| -7,200 |
d7c32c3eb47a2c0c85700c7793d40f35c830473a
|
comment printf.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scm3_hardware_interface.c",
"new_path": "bsp/boards/scum/scm3_hardware_interface.c",
"diff": "@@ -189,7 +189,7 @@ void LC_monotonic_ASC(int LC_code, unsigned int type){\nmid = mid-1;\nfine = 0;\n} else {\n- printf(\"coarse=%d,mid=%d,fine=%d\\r\\n\",coarse,mid,fine);\n+// printf(\"coarse=%d,mid=%d,fine=%d\\r\\n\",coarse,mid,fine);\n// mid = mid-1;\nfine = 0;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-830. comment printf.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.