01 / 55Sown Code Report: Aggregation Tracking Group Management
1 / 17
Télécharger la présentation
Sown Code Report: Aggregation Tracking Group Management
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Sensing Std Control SensingC Report Comm Std Control Report CommC Leds LedsC Tracking Timer TimerC Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire Local TripWire LocalM Trip WireM Static Leader Group Management Std Control BackboneC Group ManagementC Base Station Aggregation Std Control ReceiveC AggregationC Bottom Sensing Attribute Sensing BottomSensingC TrackingC Configuration Provided Interface Used Interface Module
Sensing Std Control SensingC Report Comm Std Control Report CommC Leds LedsC Tracking Timer TimerC Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire Local TripWire LocalM Trip WireM Static Leader Group Management Std Control BackboneC Group ManagementC Base Station Aggregation Std Control ReceiveC AggregationC Bottom Sensing Attribute Sensing BottomSensingC TrackingC Configuration Provided Interface Studied Modules & Configurations Used Interface Module
setParameters Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire setParameters setParameters • …
init Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire init init init init ET_POSITION_Sense whoIsMyLeader isTripWireBase • Initialize: • Sensing module. • Group management module. • ReportComm module. • Aggregation module. • Leader identifier. • TripWire information.
start Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire start start getX getY start start start • Start: • Sensing module. • Group management module. • Tracking timer. • Report module. • Aggregation module. • Localization module.
stop Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire stop stop stop stop stop • Stop: • Sensing module. • Group management module. • Tracking module. • Report module. • Aggregation module.
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire fired sendTask GMTask Periodically senseTask aggrTask Post group management task for this Tracking phase if (_isLeader) { ET_aggrCount ++; if (ET_aggrCount >= (REFRESH_INTERVAL/ENVIRO_WORKING_CLOCK)) { ET_aggrCount = 0; post aggrTask(); } } post GMTask(); if (!_isBaseLeader) { _senseCounter++; if (_senseCounter >= SENSE_CNT_THRESHOLD/ENVIRO_WORKING_CLOCK) { _senseCounter = 0; post SenseTask(); } } if (_newSensing) { ET_sendCount ++; if (ET_sendCount >= (REFRESH_INTERVAL/ENVIRO_WORKING_CLOCK)) { ET_sendCount = 0; post sendTask(); } } Post sense task If not a base Aggregate received Data if leader Send Sensing Report (Only non base motes)
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire Sensing Done SenseDoneTask • Post sensing done task.
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire Leader greenOff redOn redOff • The mote is a group leader if on_off is true. • If it is a leader: green LED off, red LED on. • If it is not a leader: green LED off, red LED off. • Update variables.
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire Member greenOff redOff greenOn • The mote is a group member if on_off is true. • If it is a member: green LED on, red LED off. • It it is not a member: green LED off, red LED off. • Update variables.
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire receiveMessage receiveReport reportPosition Base mote reports to base station event result_t RC.receiveReport(RCReport *rcReport) { dbg(DBG_TRACKING, "TrackingM.RC.receiveReport\n"); if (_isBaseLeader) { baseStation_reportPosition_struct *temp; temp = (baseStation_reportPosition_struct*)(rcReport->data); call baseStation.reportPosition(temp); } else { baseStation_reportPosition_struct *temp; temp = (baseStation_reportPosition_struct*)(rcReport->data); call GM.receiveMessage(1, temp->GMInformation); } return SUCCESS; } Other motes (only leaders can Receive reports) call the group Management module
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire aggrSendDone • This function does nothing.
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire ET_Position_senseDone • ET_ATTRIBUTES.ET_POSITION=value.
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire fireHeartBeart GMTask • Start group management heart beat.
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire conditionSense SenseTask • Initiate sensor reading
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire join leave SenseDoneTask if (_newSensing) { if (_sensing == FALSE) { _sensing = TRUE; call GM.join(); } } else { if (_sensing == TRUE) { _sensing = FALSE; if (!_isLeader || _sent) { call GM.leave(); } } } If there is a new sensing report, and the mote was not currently sensing, Seek to join group. If there is no new sensing report, And the mote was currently sensing, Seek to leave group.
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire sendData SendTask • Only non base motes. • Call aggregation module.
Tracking TrackingM Sens Sens Control Bottom Sensing GM GM Control Local Leds Tracking Timer RC RC Control BaseStation Attribute Sensing Aggr Aggr Control Static Leader Trip Wire Leave getState sendReport aggregate setState aggrTask Only Leader _GMInfo.groupAge += ET_AGGRATTRIBUTES.degreeA; call GM.setState(_GMInfo); temp.GMInformation = _GMInfo; temp.position.x = (uint16_t)(ET_AGGRATTRIBUTES.A.x); temp.position.y = (uint16_t)(ET_AGGRATTRIBUTES.A.y); call GlobalAbsoluteTimer.getGlobalTime(&timeStamp); temp.timeStamp = timeStamp.low32/100; temp.leaderID = TOS_LOCAL_ADDRESS; temp.degreeOfAggregation = ET_AGGRATTRIBUTES.degreeA; temp.degreeOfMag = ET_AGGRATTRIBUTES.degreeA; temp.degreeOfPIR = 0; temp.degreeOfAccoustic = 0; if (_isLeader) { call RC.sendReport((char *)&temp, BROADCAST_TYPE); _sent = TRUE; if (!_sensing) { call GM.leave(); } } Aggregate sensing Data baseStation_reportPosition_struct temp; tos_time_t timeStamp; dbg(DBG_TRACKING, "TrackingM.aggrTask\n"); ET_AGGRATTRIBUTES = call Aggr.aggregate(); _GMInfo = call GM.getState(); if ((ET_AGGRATTRIBUTES.degreeA + _GMInfo.groupAge) < DEGREE_OF_AGGREGATION) { if (!_sensing) { call GM.leave(); } return; } If leader did not receive enough sensing Data and is not currently sensing, Leave group without sending report. Otherwise, send Tracking report and leave group If not sensing.
ReportComm StdControl ReportCommM SendMsgByID SendMsgByBct ReceiveRoutingMsg Backbone TripWire TLeds sendDone • No message waiting to be sent.
ReportComm StdControl ReportCommM SendMsgByID SendMsgByBct ReceiveRoutingMsg Backbone TripWire TLeds sendDone • No message waiting to be sent.
ReportComm StdControl ReportCommM SendMsgByID SendMsgByBct ReceiveRoutingMsg Backbone TripWire TLeds receive ProcessReceiveMessage • Post process receive message if no other message is already waiting to be processed.
receiveReport sendReport ReportComm StdControl ReportCommM SendMsgByID SendMsgByBct ReceiveRoutingMsg Backbone TripWire TLeds ProcessReceiveMessage • If group leader, send report.