FreeRTOSFreeRTOSWindows CmbedPosix CCFreeRTOS Channel Groups API Reference for Realtime Apps

Go to Presence


Requires Stream Controller add-on XRequires that the Stream Controller add-on is enabled for your key. See this page on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
This function adds a channel to a channel group.
Adding Channels is accomplished by using the following method(s) in the FreeRTOS SDK:
  1. ParameterTypeRequiredDescription
    ppubnub_t*YesPointer to Pubnub client context.
    channelchar const*YesThe channel to add
    channel_groupchar const*YesThe channel group to add to
static char *channel_group = "family";
enum pubnub_res res;
res = pubnub_add_channel_to_group(pn, "wife", channel_group);
return check_response(pn, res);
{
    "service" : "channel-registry",
    "status"  : 200,
    "error"   : false,
    "message" : "OK"
}
Requires Stream Controller add-on XRequires that the Stream Controller add-on is enabled for your key. See this page on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
This function lists all the channels of the channel group.
Listing Channels is accomplished by using the following method(s) in the FreeRTOS SDK:
  1. ParameterTypeRequiredDescription
    ppubnub_t*YesPointer to Pubnub client context.
    channel_groupchar const*YesThe channel group to list channels from
static char *channel_group = "family";
pubnub_list_channel_group(ctx, channel_group);
pbresult = pubnub_await(ctx);
if (PNR_OK == pbresult) {
    char const *json_response = pubnub_get(ctx);
}
{
	"status" : 200,
	"payload" : {
		"channels" : ["hi"], 
		"group" : "abcd"
	},
	"service" : "channel-registry",
	"error" : False
}
Requires Stream Controller add-on XRequires that the Stream Controller add-on is enabled for your key. See this page on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
This function removes the channels from the channel group.
Removing Channels is accomplished by using the following method(s) in the FreeRTOS SDK:
  1. ParameterTypeRequiredDescription
    ppubnub_t*YesPointer to Pubnub client context.
    channelchar const*YesThe channel to remove
    channel_groupchar const*YesThe channel group to remove from
Removing channels :
static char *channel_group = "family";
enum pubnub_res res;
res = pubnub_remove_channel_from_group(pn, "son", channel_group);
return check_response(pn, res);
{
	"status" : 200,
	"message" : "OK",
	"service" : "channel-registry",
	"error" : False
}
Requires Stream Controller add-on XRequires that the Stream Controller add-on is enabled for your key. See this page on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
This function removes the channel group.
Deleting Channel Group is accomplished by using the following method(s) in the FreeRTOS SDK:
  1. ParameterTypeRequiredDescription
    ppubnub_t*YesPointer to Pubnub client context.
    channel_groupchar const*YesThe channel group to remove.
Deleting Channel Group :
static char *channel_group = "family";
enum pubnub_res res;
res = pubnub_remove_channel_group(pn, channel_group);
return check_response(pn, res);
{
	"status" : 200,
	"message" : "OK",
	"service" : "channel-registry",
	"error" : False
}

Go to Storage and Playback