User manual
Automation Protocol Extended Status Commands
Miranda Technologies Ltd Page 134
This command will respond with the status of a GPI line. The GPI number is
the zero based GPI line number between 0 and 7
CMD Param_1 Param_2
X8 %01x
0 = Video GPI Lines
1 = Audio GPI Lines (if
supported)
%02x: GPI Number
Response format
CMD Param_1 Param_2
X8 %02x: GPI No. %01x: 0=GPI off (level high), 1=GPI on (level low)
Example:
INT rem_remote_gpi_read(Premote_ rem, INT8 cmd, char * str)
{
BOOL video_gpi[MAX_GPI], audio_gpi[MAX_GPI];
int result = -1, vid_aud = -1, number = -1;
if (sscanf(str, "%01x%02x", &vid_aud, &number) == 2)
{
if (number < MAX_GPI)
{
get_gpi_state(video_gpi, audio_gpi);
if (vid_aud == 0)
{
result = video_gpi[number];
}
else
{
result = (audio_fitted ? audio_gpi[number] : -1);
}
if (result != -1)
{
rem_send_status(rem, "X8%02x%01x", number, result);
}
else
{
// 99 indicates something has gone wrong
rem_send_status(rem, "X8%02x%01x", 99, 99);
}
}