Skip to content

Commit

Permalink
Merge branch 'icd_support_for_cc13x4' of github.com:abiradarti/connec…
Browse files Browse the repository at this point in the history
…tedhomeip into icd_support_for_cc13x4
  • Loading branch information
abiradarti committed Apr 2, 2024
2 parents fee3cc0 + 4082fd7 commit 79a4a7c
Show file tree
Hide file tree
Showing 17 changed files with 241 additions and 234 deletions.
7 changes: 5 additions & 2 deletions examples/all-clusters-app/cc13x4_26x4/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ ti_simplelink_executable("all-clusters-app") {
defines = [ "CC13XX_26XX_FACTORY_DATA" ]
}

if(chip_enable_icd_server){
defines += ["CHIP_DEVICE_CONFIG_ENABLE_SED", "TI_ICD_ENABLE_SERVER"]
if (chip_enable_icd_server) {
defines += [
"CHIP_DEVICE_CONFIG_ENABLE_SED",
"TI_ICD_ENABLE_SERVER",
]
}

include_dirs = [
Expand Down
64 changes: 31 additions & 33 deletions examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ void AppTask::PostEvent(const AppEvent * aEvent)
}
}



void AppTask::DispatchEvent(AppEvent * aEvent)
{
switch (aEvent->Type)
Expand Down Expand Up @@ -390,40 +388,40 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve

void AppTask::uiInit(void)
{
#ifdef LED_ENABLE
#ifdef LED_ENABLE

LED_Params ledParams;
LED_Params ledParams;

// Initialize LEDs
PLAT_LOG("Initialize LEDs");
LED_init();
// Initialize LEDs
PLAT_LOG("Initialize LEDs");
LED_init();

LED_Params_init(&ledParams); // default PWM LED
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
LED_setOff(sAppRedHandle);
LED_Params_init(&ledParams); // default PWM LED
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
LED_setOff(sAppRedHandle);

LED_Params_init(&ledParams); // default PWM LED
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
LED_setOff(sAppGreenHandle);
#endif //LED ENABLE
LED_Params_init(&ledParams); // default PWM LED
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
LED_setOff(sAppGreenHandle);
#endif // LED ENABLE

#ifdef BUTTON_ENABLE
Button_Params buttonParams;

// Initialize buttons
PLAT_LOG("Initialize buttons");
Button_init();

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
#endif //BUTTON ENABLE
}
Button_Params buttonParams;

// Initialize buttons
PLAT_LOG("Initialize buttons");
Button_init();

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
#endif // BUTTON ENABLE
}
10 changes: 6 additions & 4 deletions examples/lighting-app/cc13x4_26x4/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ti_sysconfig("sysconfig") {
cflags = [
"-Wno-comment",
"@" + rebase_path("${target_gen_dir}/sysconfig/ti_utils_build_compiler.opt",
root_build_dir),
root_build_dir),
]
}

Expand Down Expand Up @@ -101,9 +101,11 @@ ti_simplelink_executable("lighting_app") {
defines = [ "CC13XX_26XX_FACTORY_DATA" ]
}

if(chip_enable_icd_server){
defines += ["CHIP_DEVICE_CONFIG_ENABLE_SED",
"TI_ICD_ENABLE_SERVER"]
if (chip_enable_icd_server) {
defines += [
"CHIP_DEVICE_CONFIG_ENABLE_SED",
"TI_ICD_ENABLE_SERVER",
]
}

include_dirs = [
Expand Down
80 changes: 39 additions & 41 deletions examples/lighting-app/cc13x4_26x4/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ void uiTurnedOn(void);
void uiTurnOff(void);
void uiTurnedOff(void);


#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
static DefaultOTARequestor sRequestorCore;
static DefaultOTARequestorStorage sRequestorStorage;
Expand Down Expand Up @@ -148,7 +147,7 @@ void identify_TakeAction(void)
#ifdef LED_ENABLE
LED_setOn(sAppGreenHandle, LED_BRIGHTNESS_MAX);
LED_startBlinking(sAppGreenHandle, 1000, LED_BLINK_FOREVER);
#endif //LED_ENABLE
#endif // LED_ENABLE
}

// Identify stop action
Expand All @@ -157,7 +156,7 @@ void identify_StopAction(void)
#ifdef LED_ENABLE
LED_stopBlinking(sAppGreenHandle);
LED_setOff(sAppGreenHandle);
#endif //LED_ENABLE
#endif // LED_ENABLE
}

int AppTask::Init()
Expand Down Expand Up @@ -189,8 +188,8 @@ int AppTask::Init()
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#else
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif //CHIP_DEVICE_CONFIG_ENABLE_SED
#endif //CHIP_DEVICE_CONFIG_THREAD_FTD
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
#endif // CHIP_DEVICE_CONFIG_THREAD_FTD
if (ret != CHIP_NO_ERROR)
{
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");
Expand Down Expand Up @@ -483,7 +482,7 @@ void uiTurnOn(void)
#ifdef LED_ENABLE
LED_setOn(sAppRedHandle, LED_BRIGHTNESS_MAX);
LED_startBlinking(sAppRedHandle, 110 /* ms */, LED_BLINK_FOREVER);
#endif //LED_ENABLE
#endif // LED_ENABLE
}

// Action completed callback
Expand All @@ -493,7 +492,7 @@ void uiTurnedOn(void)
#ifdef LED_ENABLE
LED_stopBlinking(sAppRedHandle);
LED_setOn(sAppRedHandle, LED_BRIGHTNESS_MAX);
#endif //LED_ENABLE
#endif // LED_ENABLE
}

// Action initiated callback
Expand All @@ -503,7 +502,7 @@ void uiTurnOff(void)
#ifdef LED_ENABLE
LED_setOn(sAppRedHandle, LED_BRIGHTNESS_MAX);
LED_startBlinking(sAppRedHandle, 110 /* ms */, LED_BLINK_FOREVER);
#endif //LED_ENABLE
#endif // LED_ENABLE
}

// Action completed callback
Expand All @@ -513,10 +512,9 @@ void uiTurnedOff(void)
#ifdef LED_ENABLE
LED_stopBlinking(sAppRedHandle);
LED_setOff(sAppRedHandle);
#endif //LED_ENABLE
#endif // LED_ENABLE
}


#ifdef BUTTON_ENABLE
void AppTask::ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events)
{
Expand Down Expand Up @@ -557,44 +555,44 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve
/* Failed to post the message */
}
}
#endif //BUTTON_ENABLE
#endif // BUTTON_ENABLE

void AppTask::uiInit(void)
{
#ifdef LED_ENABLE
#ifdef LED_ENABLE

LED_Params ledParams;
LED_Params ledParams;

// Initialize LEDs
PLAT_LOG("Initialize LEDs");
LED_init();
// Initialize LEDs
PLAT_LOG("Initialize LEDs");
LED_init();

LED_Params_init(&ledParams); // default PWM LED
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
LED_setOff(sAppRedHandle);
LED_Params_init(&ledParams); // default PWM LED
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
LED_setOff(sAppRedHandle);

LED_Params_init(&ledParams); // default PWM LED
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
LED_setOff(sAppGreenHandle);
#endif //LED ENABLE
LED_Params_init(&ledParams); // default PWM LED
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
LED_setOff(sAppGreenHandle);
#endif // LED ENABLE

#ifdef BUTTON_ENABLE
Button_Params buttonParams;

// Initialize buttons
PLAT_LOG("Initialize buttons");
Button_init();

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
#endif //BUTTON ENABLE
Button_Params buttonParams;

// Initialize buttons
PLAT_LOG("Initialize buttons");
Button_init();

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
#endif // BUTTON ENABLE
}
7 changes: 5 additions & 2 deletions examples/lock-app/cc13x4_26x4/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ ti_simplelink_executable("lock_app") {
defines = [ "CC13XX_26XX_FACTORY_DATA" ]
}

if(chip_enable_icd_server){
defines += ["CHIP_DEVICE_CONFIG_ENABLE_SED", "TI_ICD_ENABLE_SERVER"]
if (chip_enable_icd_server) {
defines += [
"CHIP_DEVICE_CONFIG_ENABLE_SED",
"TI_ICD_ENABLE_SERVER",
]
}
include_dirs = [
"${project_dir}",
Expand Down
68 changes: 34 additions & 34 deletions examples/lock-app/cc13x4_26x4/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void identify_TakeAction(void)
#ifdef LED_ENABLE
LED_setOn(sAppGreenHandle, LED_BRIGHTNESS_MAX);
LED_startBlinking(sAppGreenHandle, 1000, LED_BLINK_FOREVER);
#endif //LED_ENABLE
#endif // LED_ENABLE
}

// Identify stop action
Expand All @@ -148,7 +148,7 @@ void identify_StopAction(void)
#ifdef LED_ENABLE
LED_stopBlinking(sAppGreenHandle);
LED_setOff(sAppGreenHandle);
#endif //LED_ENABLE
#endif // LED_ENABLE
}

int AppTask::Init()
Expand Down Expand Up @@ -179,8 +179,8 @@ int AppTask::Init()
#if CHIP_DEVICE_CONFIG_ENABLE_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif //CHIP_DEVICE_CONFIG_ENABLE_SED
#endif //CHIP_DEVICE_CONFIG_THREAD_FTD
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
#endif // CHIP_DEVICE_CONFIG_THREAD_FTD

if (ret != CHIP_NO_ERROR)
{
Expand Down Expand Up @@ -577,44 +577,44 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve
/* Failed to post the message */
}
}
#endif //BUTTON_ENABLE
#endif // BUTTON_ENABLE

void AppTask::uiInit(void)
{
#ifdef LED_ENABLE

LED_Params ledParams;
LED_Params ledParams;

// Initialize LEDs
PLAT_LOG("Initialize LEDs");
LED_init();
// Initialize LEDs
PLAT_LOG("Initialize LEDs");
LED_init();

LED_Params_init(&ledParams); // default PWM LED
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
LED_setOff(sAppRedHandle);
LED_Params_init(&ledParams); // default PWM LED
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
LED_setOff(sAppRedHandle);

LED_Params_init(&ledParams); // default PWM LED
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
LED_setOff(sAppGreenHandle);
#endif //LED ENABLE
LED_Params_init(&ledParams); // default PWM LED
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
LED_setOff(sAppGreenHandle);
#endif // LED ENABLE

#ifdef BUTTON_ENABLE
Button_Params buttonParams;

// Initialize buttons
PLAT_LOG("Initialize buttons");
Button_init();

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
#endif //BUTTON ENABLE
Button_Params buttonParams;

// Initialize buttons
PLAT_LOG("Initialize buttons");
Button_init();

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);

Button_Params_init(&buttonParams);
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
buttonParams.longPressDuration = 1000U; // ms
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
#endif // BUTTON ENABLE
}
Loading

0 comments on commit 79a4a7c

Please sign in to comment.