--- libaitpelco/inc/aitpelco.h 2010/01/22 00:57:32 1.1 +++ libaitpelco/inc/aitpelco.h 2010/03/12 14:57:17 1.1.1.1.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitpelco.h,v 1.1 2010/01/22 00:57:32 misho Exp $ +* $Id: aitpelco.h,v 1.1.1.1.2.2 2010/03/12 14:57:17 misho Exp $ * *************************************************************************/ #ifndef __AITPELCO_H @@ -131,6 +131,14 @@ inline void *pelcoOpen(u_char pelcoVer, u_char camNo); inline void pelcoClose(void * __restrict p); /* + * pelcoLoad() Load packet from input buffer + * @buffer = Pelco packet from input buffer + * return: NULL error, !=NULL ok, allocated memory for packet + */ +inline void *pelcoLoad(u_char *buffer); + + +/* * pelcoAddCmdData() Add commands and datas for already opened packet * @p = Input Packet structure * @cmd[2] = Input Commands 1 & 2 @@ -139,7 +147,16 @@ inline void pelcoClose(void * __restrict p); */ inline u_char pelcoAddCmdData(void * __restrict p, u_char * __restrict cmd, u_char * __restrict data); +/* + * pelcoGetCmdData() Get from packet commands and datas with verify packet + * @p = Input Packet structure + * @cmd[2] = Output Commands 1 & 2 + * @data[2] = Output Data for commands 1 & 2 + * return: 'd' - PelcoD, 'p' - PelcoP, 0 - unknown or bad packet + */ +inline u_char pelcoGetCmdData(void * __restrict p, u_char * __restrict cmd, u_char * __restrict data); + /* * pelco_GetVersion() Return Pelco protocol version * @p = Packet structure @@ -165,7 +182,6 @@ inline u_char pelco_GetCamNo(void * __restrict p); */ inline u_char pelco_GetCamCmdData(void * __restrict p, u_char * __restrict cam, u_char * __restrict cmd, u_char * __restrict data); - /* * pelco_D_toCmd() Convert to Pelco D commands