fn transmit_event(&self, _crc_ok: ReturnCode) {
        if let Some(appid) = self.sending_app.get() {
            let _ = self.app.enter(appid, |app, _| {
                match app.process_status {
                    Some(BLEState::Advertising(RadioChannel::AdvertisingChannel37)) => {
                        app.process_status =
                            Some(BLEState::Advertising(RadioChannel::AdvertisingChannel38));
                        app.alarm_data.expiration = Expiration::Disabled;
                        self.sending_app.set(Some(app.appid()));
                        self.radio.set_tx_power(app.tx_power);
                        app.send_advertisement(&self, RadioChannel::AdvertisingChannel38);
                    }

                    Some(BLEState::Advertising(RadioChannel::AdvertisingChannel38)) => {
                        app.process_status =
                            Some(BLEState::Advertising(RadioChannel::AdvertisingChannel39));
                        self.sending_app.set(Some(app.appid()));
                        app.send_advertisement(&self, RadioChannel::AdvertisingChannel39);
                    }

                    Some(BLEState::Advertising(RadioChannel::AdvertisingChannel39)) => {
                        self.busy.set(false);
                        app.process_status = Some(BLEState::AdvertisingIdle);
                        app.set_next_alarm::<A::Frequency>(self.alarm.now());
                    }
                    // Invalid state => don't care
                    _ => (),
                }
            });
            self.reset_active_alarm();
        }
    }
// The ReturnCode indicates valid CRC or not, not used yet but could be used for
// re-tranmissions for invalid CRCs
The ReturnCode indicates valid CRC or not, not used yet but could be used for
re-tranmissions for invalid CRCs
The ReturnCode indicates valid CRC or not not used yet but could be used for re - tranmissions for invalid CRCs
fn transmit_event(&self, _crc_ok: ReturnCode) {
        if let Some(appid) = self.sending_app.get() {
            let _ = self.app.enter(appid, |app, _| {
                match app.process_status {
                    Some(BLEState::Advertising(RadioChannel::AdvertisingChannel37)) => {
                        app.process_status =
                            Some(BLEState::Advertising(RadioChannel::AdvertisingChannel38));
                        app.alarm_data.expiration = Expiration::Disabled;
                        self.sending_app.set(Some(app.appid()));
                        self.radio.set_tx_power(app.tx_power);
                        app.send_advertisement(&self, RadioChannel::AdvertisingChannel38);
                    }
                    Some(BLEState::Advertising(RadioChannel::AdvertisingChannel38)) => {
                        app.process_status =
                            Some(BLEState::Advertising(RadioChannel::AdvertisingChannel39));
                        self.sending_app.set(Some(app.appid()));
                        app.send_advertisement(&self, RadioChannel::AdvertisingChannel39);
                    }
                    Some(BLEState::Advertising(RadioChannel::AdvertisingChannel39)) => {
                        self.busy.set(false);
                        app.process_status = Some(BLEState::AdvertisingIdle);
                        app.set_next_alarm::<A::Frequency>(self.alarm.now());
                    }
                    // Invalid state => don't care
                    _ => (),
                }
            });
            self.reset_active_alarm();
        }
    }
fn transmit_event ( & self , _crc_ok : ReturnCode ) { if let Some ( appid ) = self . sending_app . get ( ) { let _ = self . app . enter ( appid , | app , _ | { match app . process_status { Some ( BLEState :: Advertising ( RadioChannel :: AdvertisingChannel37 ) ) => { app . process_status = Some ( BLEState :: Advertising ( RadioChannel :: AdvertisingChannel38 ) ) ; app . alarm_data . expiration = Expiration :: Disabled ; self . sending_app . set ( Some ( app . appid ( ) ) ) ; self . radio . set_tx_power ( app . tx_power ) ; app . send_advertisement ( & self , RadioChannel :: AdvertisingChannel38 ) ; } Some ( BLEState :: Advertising ( RadioChannel :: AdvertisingChannel38 ) ) => { app . process_status = Some ( BLEState :: Advertising ( RadioChannel :: AdvertisingChannel39 ) ) ; self . sending_app . set ( Some ( app . appid ( ) ) ) ; app . send_advertisement ( & self , RadioChannel :: AdvertisingChannel39 ) ; } Some ( BLEState :: Advertising ( RadioChannel :: AdvertisingChannel39 ) ) => { self . busy . set ( false ) ; app . process_status = Some ( BLEState :: AdvertisingIdle ) ; app . set_next_alarm :: < A :: Frequency > ( self . alarm . now ( ) ) ; } // Invalid state => don't care _ => ( ) , } } ) ; self . reset_active_alarm ( ) ; } }
The ReturnCode indicates valid CRC or not, not used yet but could be used for
re-tranmissions for invalid CRCs
The ReturnCode indicates valid CRC or not not used yet but could be used for re - tranmissions for invalid CRCs
&self
_crc_ok
ReturnCode
&self
_crc_ok
ReturnCode