[ANT+][nrf51422][s210] Bicycle Light Data Page 2 – Light Function (0x02)

Publisher:梦中徐来Latest update time:2022-09-07 Source: csdnKeywords:nrf51422 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

// {

// memcpy(ANT_message_payload_Wait_35, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_35, 1);

// }

// else if (p_incoming_data->Light_Index == 36)

// {

// memcpy(ANT_message_payload_Wait_36, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_36, 1);

// }

// else if (p_incoming_data->Light_Index == 37)

// {

// memcpy(ANT_message_payload_Wait_37, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_37, 1);

// }

// else if (p_incoming_data->Light_Index == 38)

// {

// memcpy(ANT_message_payload_Wait_38, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_38, 1);

// }

// else if (p_incoming_data->Light_Index == 39)

// {

// memcpy(ANT_message_payload_Wait_39, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_39, 1);

// }

// else if (p_incoming_data->Light_Index == 40)

// {

// memcpy(ANT_message_payload_Wait_40, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_40, 1);

// }

// else if (p_incoming_data->Light_Index == 41)

// {

// memcpy(ANT_message_payload_Wait_41, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_41, 1);

// }

// else if (p_incoming_data->Light_Index == 42)

// {

// memcpy(ANT_message_payload_Wait_42, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_42, 1);

// }

// else if (p_incoming_data->Light_Index == 43)

// {

// memcpy(ANT_message_payload_Wait_43, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_43, 1);

// }

// else if (p_incoming_data->Light_Index == 44)

// {

// memcpy(ANT_message_payload_Wait_44, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_44, 1);

// }

// else if (p_incoming_data->Light_Index == 45)

// {

// memcpy(ANT_message_payload_Wait_45, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_45, 1);

// }

// else if (p_incoming_data->Light_Index == 46)

// {

// memcpy(ANT_message_payload_Wait_46, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_46, 1);

// }

// else if (p_incoming_data->Light_Index == 47)

// {

// memcpy(ANT_message_payload_Wait_47, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_47, 1);

// }

// else if (p_incoming_data->Light_Index == 48)

// {

// memcpy(ANT_message_payload_Wait_48, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_48, 1);

// }

// else if (p_incoming_data->Light_Index == 49)

// {

// memcpy(ANT_message_payload_Wait_49, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_49, 1);

// }

// else if (p_incoming_data->Light_Index == 50)

// {

// memcpy(ANT_message_payload_Wait_50, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_50, 1);

// }

// else if (p_incoming_data->Light_Index == 51)

// {

// memcpy(ANT_message_payload_Wait_51, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_51, 1);

// }

// else if (p_incoming_data->Light_Index == 52)

// {

// memcpy(ANT_message_payload_Wait_52, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_52, 1);

// }

// else if (p_incoming_data->Light_Index == 53)

// {

// memcpy(ANT_message_payload_Wait_53, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_53, 1);

// }

// else if (p_incoming_data->Light_Index == 54)

// {

// memcpy(ANT_message_payload_Wait_54, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_54, 1);

// }

// else if (p_incoming_data->Light_Index == 55)

// {

// memcpy(ANT_message_payload_Wait_55, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_55, 1);

// }

// else if (p_incoming_data->Light_Index == 56)

// {

// memcpy(ANT_message_payload_Wait_56, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_56, 1);

// }

// else if (p_incoming_data->Light_Index == 57)

// {

// memcpy(ANT_message_payload_Wait_57, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_57, 1);

// }

// else if (p_incoming_data->Light_Index == 58)

// {

// memcpy(ANT_message_payload_Wait_58, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_58, 1);

// }

// else if (p_incoming_data->Light_Index == 59)

// {

// memcpy(ANT_message_payload_Wait_59, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_59, 1);

// }

// else if (p_incoming_data->Light_Index == 60)

// {

// memcpy(ANT_message_payload_Wait_60, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_60, 1);

// }

// else if (p_incoming_data->Light_Index == 61)

// {

// memcpy(ANT_message_payload_Wait_61, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_61, 1);

// }

// else if (p_incoming_data->Light_Index == 62)

// {

// memcpy(ANT_message_payload_Wait_62, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_62, 1);

// }

// else if (p_incoming_data->Light_Index == 63)

// {

// memcpy(ANT_message_payload_Wait_63, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Channel_sens_message_encode(ANT_message_payload_Wait_63, 1);

// }


            ANT_PAGE_NEW_Wait = 2; //Send the specified page

        }

        else

        {

            if (SystemInit_Type.ANT_SHARED_CHANNEL == 1 && SystemReg.ANT_SHARED_CHANNEL == 2)

            {

                uint32_t err_code;

                memcpy(ANT_message_payload_Shared_Wait, p_incoming_data, sizeof(ant_BikeLight_page2_data_t)); //Copy non-self content to the shared channel buffer

// ANT_Relay_New_Share_Page = 2; //Send the specified page

                ANT_Shared_Channel_sens_message_encode(ANT_message_payload_Shared_Wait, 2); //Reorganize the command

                err_code = ANT_Send_Message(BikeLight_Shared_CHANNEL_NUMBER, ANT_message_payload_Shared_Wait);

                SEGGER_RTT_printf(0, "[Channel1_Forward]---TX page_%02d: %02X %02X %02X %02X %02X %02X %02X %02X --err_code:%dnr",

                                  2, Replace_Buff(ANT_message_payload_Shared_Wait), err_code); //Print and send shared command

//ANT_Relay_New_Share_Page = 0; //Reset

            }

            else

            {

                SEGGER_RTT_printf(0, "No ININ ANT_SHARED_CHANNEL!!!rn");

            }

        }

    }

}



```c

/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.

 *

 * The information contained herein is property of Nordic Semiconductor ASA.

 * Terms and conditions of usage are described in detail in NORDIC

 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.

 *

 * Licensees are granted free, non-transferable use of the information. NO

 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from

 * the file.

 *

 */

#ifndef ANT_BIKELIGHT_PAGE_2_H__

#define ANT_BIKELIGHT_PAGE_2_H__

/*************Light_State_ModeNum***Supported standard mode bit fields************************

LSB:

0 Reserved for future use. Set to 0

1 Always on: 81 - 100% brightness 0--Not supported 1--Supported

2 Always on: 61 - 80% brightness 0--Not supported 1--Supported

3 Always on: 41 - 60% brightness 0--Not supported 1--Supported

4 Always on: 21 - 40% brightness 0--Not supported 1--Supported

5 Constantly on: 0 - 20% brightness 0--Not supported 1--Supported

6 Slow flash 0--Not supported 1--Supported

7 Fast flashing 0--Not supported 1--Supported


MSB:

0 Random flashing 0--Not supported 1--Supported

1 Automatic 0--Not supported 1--Supported

[1] [2] [3] [4]
Keywords:nrf51422 Reference address:[ANT+][nrf51422][s210] Bicycle Light Data Page 2 – Light Function (0x02)

Previous article:[vscode][nrf51][nrf52] uint8_t uint16_t uint32_t etc. variables are abnormal
Next article:[ANT+][nrf51422][s210] Bicycle Light Data Page 1 – Light Status 1 (0x01)

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号