You are here: CSP API Reference > 1 EXS & SwitchKit API Messages > ChannelGroupContentsQuery

ChannelGroupContentsQuery

Type:

EXS SwitchKit API message

Description

Use the SK_ChannelGroupContentsQuery to query the contents of the channel group by name. The acknowledgment SK_ChannelGroupContentsQueryAck contains the number of channels in that group as well as all the spans and channels.

To process all these channels, you use the following code:

SK_MSG_SWITCH(msg) {

CASE_ChannelGroupContentsQueryAck(ack) {

int i;

UBYTE *dta = ack->Channels;

for (i=0;i<ack->NumChannels;i++)

{

short span = ntohs(*(short *)dta);

int chan = (int)dta[2];

processChannel(span,chan);

dta += 3;

}

}

} SK_END_SWITCH;

The format of the Channels data structure is two bytes for the span in network byte order, followed by one byte representing the channel offset.

Sent by

Application

C Structure

typedef struct {

char GroupName[50];

UBYTE reserved67[23];

} SK_ChannelGroupContentsQuery;

C Structure Response

typedef struct {

int Status;

int NumChannels;

UBYTE Channels[245];

} SK_ChannelGroupContentsQueryAck;

C++ Class

class SKC_ChannelGroupContentsQuery : public SKC_ToolkitMessage {

public:

const char *getGroupName() const;

void setGroupName(const char *x);

};

C++ Class Response

class SKC_ChannelGroupContentsQueryAck : public SKC_ToolkitAck {

public:

int getStatus() const;

void setStatus(int x);

int getNumChannels() const;

void setNumChannels(int x);

const UBYTE *getChannels() const;

UBYTE *getChannels();

void setChannels(UBYTE *x);

};

Status Field Return Values

The possible status values are:

OK

Query successful acknowledged.

SK_INVALID_GROUP

The GroupName in the query does not exist.

Arguments

GroupName: Name of Group to be queried.