Skip to content

Commit

Permalink
Rename gen/*.c files to cpp (#3754)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored Nov 11, 2020
1 parent c23b992 commit eda6980
Show file tree
Hide file tree
Showing 55 changed files with 61 additions and 230 deletions.
6 changes: 3 additions & 3 deletions examples/all-clusters-app/all-clusters-common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ source_set("all-clusters-common") {
"${chip_root}/src/app/util/process-cluster-message.cpp",
"${chip_root}/src/app/util/process-global-message.cpp",
"${chip_root}/src/app/util/util.cpp",
"gen/call-command-handler.c",
"gen/callback-stub.c",
"gen/clusters-callback-stubs.c",
"gen/call-command-handler.cpp",
"gen/callback-stub.cpp",
"gen/clusters-callback-stubs.cpp",
]

deps = [
Expand Down
7 changes: 0 additions & 7 deletions examples/all-clusters-app/all-clusters-common/gen/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
//#include "hal/hal.h"
//#include EMBER_AF_API_NETWORK_STEERING

#ifdef __cplusplus
extern "C" {
#endif // #ifdef __cplusplus

/** @name Non-Cluster Related Callbacks */
// @{
/** @brief Add To Current App Tasks
Expand Down Expand Up @@ -23363,8 +23359,5 @@ void halSleepCallback(bool enter, SleepModes sleepMode);
/** @} END HAL Library Plugin Callbacks */

/** @} END addtogroup */
#ifdef __cplusplus
}
#endif // #ifdef __cplusplus

#endif // SILABS_EMBER_AF_CALLBACK_PROTOTYPES
10 changes: 4 additions & 6 deletions examples/all-clusters-app/esp32/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,16 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
exit:
return err;
}
} // namespace DeviceManager
} // namespace chip

extern "C" {
void emberAfPostAttributeChangeCallback(uint8_t endpointId, EmberAfClusterId clusterId, EmberAfAttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{
CHIPDeviceManagerCallbacks * cb = CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
if (cb != nullptr)
{
cb->PostAttributeChangeCallback(endpointId, clusterId, attributeId, mask, manufacturerCode, type, size, value);
}
}
} // extern "C"

} // namespace DeviceManager
} // namespace chip
7 changes: 2 additions & 5 deletions examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@
#include "WiFiWidget.h"
#include "esp_heap_caps.h"
#include "esp_log.h"
#include <lib/mdns/DiscoveryManager.h>
#include <support/CodeUtils.h>

extern "C" {
#include "gen/attribute-id.h"
#include "gen/cluster-id.h"
} // extern "C"
#include <lib/mdns/DiscoveryManager.h>
#include <support/CodeUtils.h>

static const char * TAG = "echo-devicecallbacks";

Expand Down
2 changes: 0 additions & 2 deletions examples/all-clusters-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ using namespace chip::Inet;
using namespace chip::Transport;
using namespace chip::DeviceLayer;

extern "C" {
void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{}
} // extern "C"

int main(int argc, char * argv[])
{
Expand Down
2 changes: 0 additions & 2 deletions examples/common/chip-app-server/DataModelHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

using namespace ::chip;

extern "C" {
/**
* Handle a message that should be processed via our data model processing
* codepath. This function will free the packet buffer.
Expand Down Expand Up @@ -81,4 +80,3 @@ void InitDataModelHandler()
emberAfEndpointConfigure();
emberAfInit();
}
}
2 changes: 0 additions & 2 deletions examples/common/chip-app-server/include/DataModelHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <transport/SecureSessionMgr.h>
#include <transport/raw/MessageHeader.h>

extern "C" {
/**
* Handle a message that should be processed via our data model processing
* codepath.
Expand All @@ -37,4 +36,3 @@ extern "C" {
void HandleDataModelMessage(const chip::PacketHeader & header, chip::System::PacketBuffer * buffer,
chip::SecureSessionMgrBase * mgr);
void InitDataModelHandler();
}
7 changes: 3 additions & 4 deletions examples/lighting-app/efr32/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@

// using namespace ::chip;

extern "C" void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size,
uint8_t * value)
void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down Expand Up @@ -65,7 +64,7 @@ extern "C" void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClus
*
* @param endpoint Endpoint that is being initialized Ver.: always
*/
extern "C" void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint)
void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint)
{
// TODO: implement any additional On/off Cluster Server post init actions
}
4 changes: 2 additions & 2 deletions examples/lighting-app/lighting-common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ source_set("lighting-common") {
"${chip_root}/src/app/util/process-cluster-message.cpp",
"${chip_root}/src/app/util/process-global-message.cpp",
"${chip_root}/src/app/util/util.cpp",
"gen/call-command-handler.c",
"gen/callback-stub.c",
"gen/call-command-handler.cpp",
"gen/callback-stub.cpp",
]

deps = [
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ using namespace chip::DeviceLayer;

constexpr uint32_t kDefaultSetupPinCode = 12345678; // TODO: Should be a macro in CHIPProjectConfig.h like other example apps.

extern "C" {
void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{
Expand Down Expand Up @@ -86,7 +85,6 @@ void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint)
{
// TODO: implement any additional On/off Cluster Server post init actions
}
}

namespace {
void EventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg)
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ target_sources(app PRIVATE
main/LightingManager.cpp
main/main.cpp
main/ZclCallbacks.cpp
${LIGHTING_COMMON}/gen/call-command-handler.c
${LIGHTING_COMMON}/gen/callback-stub.c
${LIGHTING_COMMON}/gen/call-command-handler.cpp
${LIGHTING_COMMON}/gen/callback-stub.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/NFCWidget.cpp
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/nrfconnect/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "AppTask.h"
#include "LightingManager.h"

extern "C" {
void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{
Expand Down Expand Up @@ -57,4 +56,3 @@ void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint)
{
GetAppTask().UpdateClusterState();
}
}
7 changes: 3 additions & 4 deletions examples/lock-app/efr32/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@

// using namespace ::chip;

extern "C" void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size,
uint8_t * value)
void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down Expand Up @@ -66,7 +65,7 @@ extern "C" void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClus
*
* @param endpoint Endpoint that is being initialized Ver.: always
*/
extern "C" void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint)
void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint)
{
// TODO: implement any additional On/off Cluster Server post init actions
}
2 changes: 0 additions & 2 deletions examples/lock-app/k32w/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

using namespace ::chip;

extern "C" {
void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{
Expand Down Expand Up @@ -58,4 +57,3 @@ void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint)
{
// TODO: implement any additional On/off Cluster Server post init actions
}
}
4 changes: 2 additions & 2 deletions examples/lock-app/lock-common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ source_set("lock-common") {
"${chip_root}/src/app/util/process-cluster-message.cpp",
"${chip_root}/src/app/util/process-global-message.cpp",
"${chip_root}/src/app/util/util.cpp",
"gen/call-command-handler.c",
"gen/callback-stub.c",
"gen/call-command-handler.cpp",
"gen/callback-stub.cpp",
]

deps = [
Expand Down
4 changes: 2 additions & 2 deletions examples/lock-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ target_sources(app PRIVATE
main/BoltLockManager.cpp
main/main.cpp
main/ZclCallbacks.cpp
${LOCK_COMMON}/gen/call-command-handler.c
${LOCK_COMMON}/gen/callback-stub.c
${LOCK_COMMON}/gen/call-command-handler.cpp
${LOCK_COMMON}/gen/callback-stub.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/NFCWidget.cpp
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp
Expand Down
2 changes: 0 additions & 2 deletions examples/lock-app/nrfconnect/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

using namespace ::chip;

extern "C" {
void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{
Expand Down Expand Up @@ -59,4 +58,3 @@ void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint)
{
GetAppTask().UpdateClusterState();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
return err;
}

extern "C" {
void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{
Expand All @@ -103,7 +102,6 @@ void emberAfPostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clust
cb->PostAttributeChangeCallback(endpoint, clusterId, attributeId, mask, manufacturerCode, type, size, value);
}
}
} // extern "C"

} // namespace DeviceManager
} // namespace chip
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@
**/
#include "DeviceCallbacks.h"

#include "../gen/attribute-id.h"
#include "../gen/cluster-id.h"
#include "esp_heap_caps.h"
#include "esp_log.h"
#include <support/CodeUtils.h>

extern "C" {
#include "../gen/attribute-id.h"
#include "../gen/cluster-id.h"
} // extern "C"

static const char * TAG = "echo-devicecallbacks";

using namespace ::chip::Inet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static State state;
// TODO: There's no header that declares this callback, and it's not 100%
// clear where best to declare it.
// https://github.com/project-chip/connectedhomeip/issues/3619
extern "C" void emberAfPluginBarrierControlServerInitCallback(void) {}
void emberAfPluginBarrierControlServerInitCallback(void) {}

// -----------------------------------------------------------------------------
// Accessing attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ static bool computeNewHueValue(ColorHueTransitionState * p)
return false;
}

extern "C" void emberAfPluginColorControlServerHueSatTransitionEventHandler(void)
void emberAfPluginColorControlServerHueSatTransitionEventHandler(void)
{
EndpointId endpoint = colorHueTransitionState.endpoint;
bool limitReached1, limitReached2;
Expand Down Expand Up @@ -1676,7 +1676,7 @@ static uint16_t computeTransitionTimeFromStateAndRate(Color16uTransitionState *
return (uint16_t) transitionTime;
}

extern "C" void emberAfPluginColorControlServerXyTransitionEventHandler(void)
void emberAfPluginColorControlServerXyTransitionEventHandler(void)
{
EndpointId endpoint = colorXTransitionState.endpoint;
bool limitReachedX, limitReachedY;
Expand Down Expand Up @@ -1705,7 +1705,7 @@ extern "C" void emberAfPluginColorControlServerXyTransitionEventHandler(void)
emberAfPluginColorControlServerComputePwmFromXyCallback(endpoint);
}

extern "C" void emberAfPluginColorControlServerTempTransitionEventHandler(void)
void emberAfPluginColorControlServerTempTransitionEventHandler(void)
{
EndpointId endpoint = colorTempTransitionState.endpoint;
bool limitReached;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void setLanguage(void)
}
}

extern "C" void emberAfPluginDoorLockServerInitCallback(void)
void emberAfPluginDoorLockServerInitCallback(void)
{
emAfPluginDoorLockServerInitUser();
emAfPluginDoorLockServerInitSchedule();
Expand Down
4 changes: 2 additions & 2 deletions src/app/clusters/door-lock-server/door-lock-server-user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ static EmberAfStatus applyCode(uint8_t * code, uint8_t codeLength, EmberAfPlugin
return EMBER_ZCL_STATUS_FAILURE;
}

extern "C" void emberAfPluginDoorLockServerLockoutEventHandler(void)
void emberAfPluginDoorLockServerLockoutEventHandler(void)
{
emberEventControlSetInactive(&emberAfPluginDoorLockServerLockoutEventControl);

Expand Down Expand Up @@ -716,7 +716,7 @@ static void scheduleAutoRelock(uint32_t autoRelockTimeS)
}
}

extern "C" void emberAfPluginDoorLockServerRelockEventHandler(void)
void emberAfPluginDoorLockServerRelockEventHandler(void)
{
emberEventControlSetInactive(&emberAfPluginDoorLockServerRelockEventControl);

Expand Down
8 changes: 0 additions & 8 deletions src/app/clusters/ias-zone-client/ias-zone-client.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,10 @@ extern IasZoneDevice emberAfIasZoneClientKnownServers[];

#define UNKNOWN_ZONE_ID 0xFF

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

void emAfClearServers(void);

void emberAfPluginIasZoneClientZdoCallback(EmberNodeId emberNodeId, EmberApsFrame * apsFrame, uint8_t * message, uint16_t length);

void emberAfPluginIasZoneClientWriteAttributesResponseCallback(EmberAfClusterId clusterId, uint8_t * buffer, uint16_t bufLen);

void emberAfPluginIasZoneClientReadAttributesResponseCallback(EmberAfClusterId clusterId, uint8_t * buffer, uint16_t bufLen);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion src/app/clusters/ias-zone-server/ias-zone-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ EmberStatus emberAfPluginIasZoneServerUpdateZoneStatus(EndpointId endpoint, uint
return sendStatus;
}

extern "C" void emberAfPluginIasZoneServerManageQueueEventHandler(void)
void emberAfPluginIasZoneServerManageQueueEventHandler(void)
{
#if defined(EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ENABLE_QUEUE)
IasZoneStatusQueueEntry * bufferStart;
Expand Down
Loading

0 comments on commit eda6980

Please sign in to comment.