This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to reconfigure a channel?

Hi,

I want to build a Tx that can reconfigure a channel(like change the device's number) after finding out a long time failed to send message.I use the way below: sd_ant_channel_close(channel); ant_channel_tx_acknowledged_setup(channel);//come from the routine of broadcast.

But it seems that it doesn't go as planned,can somebody tell me why?

Parents
  • You need to listen to the channel closed event.

    First close the channel as you do with sd_ant_channel_close(channel). Then unassign the channel once it is closed. Here is an exerpt from my code:

     case EVENT_CHANNEL_CLOSED:
                                sd_ant_channel_unassign(CHANNEL_0);
                                toggle_roles(&master);
                                break;
    

    Where toggle_roles then does the ant_channel_tx_broadcast_setup from the broadcast example.

    You should get UART working and read out the error codes. They tell you a lot.

    Cheers!

Reply
  • You need to listen to the channel closed event.

    First close the channel as you do with sd_ant_channel_close(channel). Then unassign the channel once it is closed. Here is an exerpt from my code:

     case EVENT_CHANNEL_CLOSED:
                                sd_ant_channel_unassign(CHANNEL_0);
                                toggle_roles(&master);
                                break;
    

    Where toggle_roles then does the ant_channel_tx_broadcast_setup from the broadcast example.

    You should get UART working and read out the error codes. They tell you a lot.

    Cheers!

Children
No Data
Related