diff --git a/drivers/common/openserial.c b/drivers/common/openserial.c index d7fb3ef2d0..2380949988 100644 --- a/drivers/common/openserial.c +++ b/drivers/common/openserial.c @@ -601,6 +601,18 @@ void openserial_goldenImageCommands(void){ case COMMAND_SET_SLOTDURATION: ieee154e_setSlotDuration(comandParam_16); break; + case COMMAND_SET_6PRESPONSE_STATUS: + if (comandParam_8 ==1) { + sixtop_setIsResponseEnabled(TRUE); + } else { + if (comandParam_8 == 0) { + sixtop_setIsResponseEnabled(FALSE); + } else { + // security only can be 1 or 0 + break; + } + } + break; default: // wrong command ID break; diff --git a/drivers/common/openserial.h b/drivers/common/openserial.h index 0926274802..5381dd620e 100644 --- a/drivers/common/openserial.h +++ b/drivers/common/openserial.h @@ -74,7 +74,8 @@ enum { COMMAND_SET_6P_LIST = 12, COMMAND_SET_6P_CLEAR = 13, COMMAND_SET_SLOTDURATION = 14, - COMMAND_MAX = 15, + COMMAND_SET_6PRESPONSE_STATUS = 15, + COMMAND_MAX = 16, }; //=========================== module variables ================================ diff --git a/openstack/02b-MAChigh/sixtop.c b/openstack/02b-MAChigh/sixtop.c index da105895df..89df02fe92 100644 --- a/openstack/02b-MAChigh/sixtop.c +++ b/openstack/02b-MAChigh/sixtop.c @@ -113,6 +113,7 @@ void sixtop_init() { sixtop_vars.mgtTaskCounter = 0; sixtop_vars.kaPeriod = MAXKAPERIOD; sixtop_vars.ebPeriod = EBPERIOD; + sixtop_vars.isResponseEnabled = TRUE; sixtop_vars.maintenanceTimerId = opentimers_start( sixtop_vars.periodMaintenance, @@ -597,6 +598,10 @@ bool debugPrint_kaPeriod() { return TRUE; } +void sixtop_setIsResponseEnabled(bool isEnabled){ + sixtop_vars.isResponseEnabled = isEnabled; +} + //=========================== private ========================================= /** @@ -1186,8 +1191,10 @@ void sixtop_notifyReceiveCommand( processIE_prepend_sixtopIE(response_pkt,len); // indicate IEs present response_pkt->l2_payloadIEpresent = TRUE; - // send packet - sixtop_send(response_pkt); + if (sixtop_vars.isResponseEnabled){ + // send packet + sixtop_send(response_pkt); + } // update state sixtop_vars.six2six_state = SIX_WAIT_RESPONSE_SENDDONE; // arm timeout diff --git a/openstack/02b-MAChigh/sixtop.h b/openstack/02b-MAChigh/sixtop.h index 2147986361..7f597ca14f 100644 --- a/openstack/02b-MAChigh/sixtop.h +++ b/openstack/02b-MAChigh/sixtop.h @@ -89,6 +89,7 @@ typedef struct { six2six_state_t six2six_state; uint8_t commandID; six2six_handler_t handler; + bool isResponseEnabled; } sixtop_vars_t; //=========================== prototypes ====================================== @@ -111,6 +112,8 @@ void task_sixtopNotifReceive(void); // debugging bool debugPrint_myDAGrank(void); bool debugPrint_kaPeriod(void); +// control +void sixtop_setIsResponseEnabled(bool isEnabled); /** \} diff --git a/projects/python/SConscript.env b/projects/python/SConscript.env index fea780008e..7b9b3d11be 100644 --- a/projects/python/SConscript.env +++ b/projects/python/SConscript.env @@ -600,6 +600,7 @@ functionsToChange = [ 'task_sixtopNotifReceive', 'debugPrint_myDAGrank', 'debugPrint_kaPeriod', + 'sixtop_setIsResponseEnabled', 'sixtop_send_internal', 'sixtop_maintenance_timer_cb', 'sixtop_timeout_timer_cb',