Diff for /libaitpelco/src/aitpelco.c between versions 1.3 and 1.4

version 1.3, 2012/07/22 22:21:50 version 1.4, 2013/05/30 09:20:16
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 56  static char pelco_Error[STRSIZ]; Line 56  static char pelco_Error[STRSIZ];
 //  //
   
 // pelco_GetErrno() Get error code of last operation  // pelco_GetErrno() Get error code of last operation
inline intint
 pelco_GetErrno()  pelco_GetErrno()
 {  {
         return pelco_Errno;          return pelco_Errno;
 }  }
   
 // pelco_GetError() Get error text of last operation  // pelco_GetError() Get error text of last operation
inline const char *const char *
 pelco_GetError()  pelco_GetError()
 {  {
         return pelco_Error;          return pelco_Error;
 }  }
   
 // pelco_SetErr() Set error to variables for internal use!!!  // pelco_SetErr() Set error to variables for internal use!!!
inline voidvoid
 pelcoSetErr(int eno, char *estr, ...)  pelcoSetErr(int eno, char *estr, ...)
 {  {
         va_list lst;          va_list lst;
Line 90  pelcoSetErr(int eno, char *estr, ...) Line 90  pelcoSetErr(int eno, char *estr, ...)
  * @camNo = Packet for camera number address   * @camNo = Packet for camera number address
  * return: NULL error, !=NULL ok, allocated memory for packet   * return: NULL error, !=NULL ok, allocated memory for packet
  */   */
inline void *void *
 pelcoOpen(u_char pelcoVer, u_char camNo)  pelcoOpen(u_char pelcoVer, u_char camNo)
 {  {
         pelco_d_t *pd;          pelco_d_t *pd;
Line 143  pelcoOpen(u_char pelcoVer, u_char camNo) Line 143  pelcoOpen(u_char pelcoVer, u_char camNo)
  * pelcoClose() Close packet record and free memory   * pelcoClose() Close packet record and free memory
  * @p = Packet structure for close   * @p = Packet structure for close
  */   */
inline voidvoid
 pelcoClose(void * __restrict p)  pelcoClose(void * __restrict p)
 {  {
         if (p)          if (p)
Line 155  pelcoClose(void * __restrict p) Line 155  pelcoClose(void * __restrict p)
  * @buffer = Pelco packet from input buffer   * @buffer = Pelco packet from input buffer
  * return: NULL error, !=NULL ok, allocated memory for packet   * return: NULL error, !=NULL ok, allocated memory for packet
  */   */
inline void *void *
 pelcoLoad(u_char *buffer)  pelcoLoad(u_char *buffer)
 {  {
         pelco_d_t *pd;          pelco_d_t *pd;
Line 208  pelcoLoad(u_char *buffer) Line 208  pelcoLoad(u_char *buffer)
  * @data[2] = Input Data for commands 1 & 2   * @data[2] = Input Data for commands 1 & 2
  * return: 0xFF - error, 0 - ok   * return: 0xFF - error, 0 - ok
  */   */
inline u_charu_char
 pelcoAddCmdData(void * __restrict p, u_char * __restrict cmd, u_char * __restrict data)  pelcoAddCmdData(void * __restrict p, u_char * __restrict cmd, u_char * __restrict data)
 {  {
         u_char ret = 0;          u_char ret = 0;
Line 261  pelcoAddCmdData(void * __restrict p, u_char * __restri Line 261  pelcoAddCmdData(void * __restrict p, u_char * __restri
  * @data[2] = Output Data for commands 1 & 2   * @data[2] = Output Data for commands 1 & 2
  * return: 'd' - PelcoD, 'p' - PelcoP, 0 - unknown or bad packet   * return: 'd' - PelcoD, 'p' - PelcoP, 0 - unknown or bad packet
  */   */
inline u_charu_char
 pelcoGetCmdData(void * __restrict p, u_char * __restrict cmd, u_char * __restrict data)  pelcoGetCmdData(void * __restrict p, u_char * __restrict cmd, u_char * __restrict data)
 {  {
         return pelco_GetCamCmdData(p, NULL, cmd, data);          return pelco_GetCamCmdData(p, NULL, cmd, data);
Line 273  pelcoGetCmdData(void * __restrict p, u_char * __restri Line 273  pelcoGetCmdData(void * __restrict p, u_char * __restri
  * @correct = Calculate new check sum if incorrect !=0, if ==0 only check   * @correct = Calculate new check sum if incorrect !=0, if ==0 only check
  * return: 0xFF - bad packet, 1 invalid check sum, 0 check sum is correct.   * return: 0xFF - bad packet, 1 invalid check sum, 0 check sum is correct.
  */   */
inline u_charu_char
 pelcoChkSum(void * __restrict p, u_char correct)  pelcoChkSum(void * __restrict p, u_char correct)
 {  {
         u_char sum, *ptr = p;          u_char sum, *ptr = p;

Removed from v.1.3  
changed lines
  Added in v.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>