Sample communication application – Beijer Electronics SCOM Protocol EN User Manual

Page 127

Advertising
background image

Sample Communication Application

Beijer Electronics, MAEN975

127

/*=======================================================================

A local version of strupr.

*/

char*

mystrupr(char *pc)

{

char *pcu;

/*========*/

for (pcu=pc;*pcu!=0;pcu++)

*pcu=toupper(*pcu);

return pc;

}

/*=======================================================================

Displays the given message and software usage.

*/

void

printUsage(char *pucMessage)

{

printf(">>> ");

printf(pucMessage);

printf("."_ _);

printf(_

"Usage:"_

"------"_

" lscom <adr> <cmd> [<data0> <data1> ... <data73>]"_

_

" <adr> : Monitor group/address"_

" <cmd> : SCOM command (not case sensitive)"_

" <dataN>: Optional data byte(s) (sub-command/parameter)"_

_

" Numeric values can be written either in decimal or hexadecimal."_

" The type of all numeric values is BYTE."_

_

" This application uses the UDP ports 10000/10001."_

_

_

"Examples:"_

"---------"_

" Set digital output port bit 1 of monitor at address 7 (0.7):"_

" lscom 0x07 LAU 0x02 0x03 0x02"_

_

" Set brightness of monitor at address 1.5 to 200:"_

" lscom 0x15 BRT 200"_

_

" Query manufacturer ID of monitor at address 3.14:"_

" lscom 0x3E MAN"_

_);

}

/*=======================================================================

Displays the given error message in a formatted style.

*/

void

printError(char *pucError)

{

printf("> ERROR: ");

printf(pucError);

printf("."_);

}

/*=======================================================================

Advertising