Skip to content

Commit

Permalink
Move Groups Plugin callbacks into src/app/groups-server (#3750)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored Nov 10, 2020
1 parent 85d4bf9 commit 5230b2d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 64 deletions.
33 changes: 0 additions & 33 deletions examples/all-clusters-app/all-clusters-common/gen/callback-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,39 +65,6 @@ void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint) {}
*/
void emberAfPluginLevelControlClusterServerPostInitCallback(uint8_t endpoint) {}

/** @brief Get Group Name
*
* This function returns the name of a group with the provided group ID, should
* it exist.
*
* @param endpoint Endpoint Ver.: always
* @param groupId Group ID Ver.: always
* @param groupName Group Name Ver.: always
*/
void emberAfPluginGroupsServerGetGroupNameCallback(uint8_t endpoint, uint16_t groupId, uint8_t * groupName) {}

/** @brief Group Names Supported
*
* This function is called by the framework when it is necessary to determine
* whether or not group names are supported.
*
* @param endpoint The endpoint. Ver.: always
*/
bool emberAfPluginGroupsServerGroupNamesSupportedCallback(uint8_t endpoint)
{
return false;
}

/** @brief Set Group Name
*
* This function sets the name of a group with the provided group ID.
*
* @param endpoint Endpoint Ver.: always
* @param groupId Group ID Ver.: always
* @param groupName Group Name Ver.: always
*/
void emberAfPluginGroupsServerSetGroupNameCallback(uint8_t endpoint, uint16_t groupId, uint8_t * groupName) {}

/** @brief Add To Current App Tasks
*
* This function is only useful to sleepy end devices. This function will note
Expand Down
31 changes: 0 additions & 31 deletions examples/all-clusters-app/all-clusters-common/gen/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -2229,37 +2229,6 @@ bool emberAfGroupsClusterViewGroupResponseCallback(uint8_t status, uint16_t grou

/** @} END Groups Cluster Callbacks */

/** @name Groups Server Cluster Plugin Callbacks */
// @{

/** @brief Get Group Name
*
* This function returns the name of a group with the provided group ID, should
* it exist.
*
* @param endpoint Endpoint Ver.: always
* @param groupId Group ID Ver.: always
* @param groupName Group Name Ver.: always
*/
void emberAfPluginGroupsServerGetGroupNameCallback(uint8_t endpoint, uint16_t groupId, uint8_t * groupName);
/** @brief Set Group Name
*
* This function sets the name of a group with the provided group ID.
*
* @param endpoint Endpoint Ver.: always
* @param groupId Group ID Ver.: always
* @param groupName Group Name Ver.: always
*/
void emberAfPluginGroupsServerSetGroupNameCallback(uint8_t endpoint, uint16_t groupId, uint8_t * groupName);
/** @brief Group Names Supported
*
* This function returns whether or not group names are supported.
*
* @param endpoint Endpoint Ver.: always
*/
bool emberAfPluginGroupsServerGroupNamesSupportedCallback(uint8_t endpoint);
/** @} END Groups Server Cluster Plugin Callbacks */

/** @name Scenes Cluster Callbacks */
// @{

Expand Down
10 changes: 10 additions & 0 deletions src/app/clusters/groups-server/groups-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
// *
// * Copyright 2010 by Ember Corporation. All rights reserved. *80*
// *******************************************************************
#include "groups-server.h"

#include <app/util/af.h>
#include <app/util/binding-table.h>
Expand Down Expand Up @@ -446,3 +447,12 @@ static uint8_t findGroupIndex(EndpointId endpoint, GroupId groupId)
}
return EMBER_AF_GROUP_TABLE_NULL_INDEX;
}

void emberAfPluginGroupsServerGetGroupNameCallback(EndpointId endpoint, GroupId groupId, uint8_t * groupName) {}

bool emberAfPluginGroupsServerGroupNamesSupportedCallback(EndpointId endpoint)
{
return false;
}

void emberAfPluginGroupsServerSetGroupNameCallback(EndpointId endpoint, GroupId groupId, uint8_t * groupName) {}
49 changes: 49 additions & 0 deletions src/app/clusters/groups-server/groups-server.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
*
* Copyright (c) 2020 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include <app/util/basic-types.h>

/** @brief Get Group Name
*
* This function returns the name of a group with the provided group ID, should
* it exist.
*
* @param endpoint Endpoint Ver.: always
* @param groupId Group ID Ver.: always
* @param groupName Group Name Ver.: always
*/
void emberAfPluginGroupsServerGetGroupNameCallback(CHIPEndpointId endpoint, CHIPGroupId groupId, uint8_t * groupName);

/** @brief Set Group Name
*
* This function sets the name of a group with the provided group ID.
*
* @param endpoint Endpoint Ver.: always
* @param groupId Group ID Ver.: always
* @param groupName Group Name Ver.: always
*/
void emberAfPluginGroupsServerSetGroupNameCallback(CHIPEndpointId endpoint, CHIPGroupId groupId, uint8_t * groupName);

/** @brief Group Names Supported
*
* This function returns whether or not group names are supported.
*
* @param endpoint Endpoint Ver.: always
*/
bool emberAfPluginGroupsServerGroupNamesSupportedCallback(CHIPEndpointId endpoint);

0 comments on commit 5230b2d

Please sign in to comment.