Browse Source

Add function serialPutBin() for put binarys to serial.

Signed-off-by: Thiti Yamsung <thiti.59h@gmail.com>
pull/44/head^2
Thiti Yamsung 8 years ago
parent
commit
87c3fd0d05
2 changed files with 12 additions and 0 deletions
  1. +11
    -0
      wiringPi/wiringSerial.c
  2. +1
    -0
      wiringPi/wiringSerial.h

+ 11
- 0
wiringPi/wiringSerial.c View File

@@ -159,6 +159,17 @@ void serialPuts (const int fd, const char *s)
}

/*
* serialPuts:
* Send binarys to serial port
*********************************************************************************
*/

void serialPutBin (const int fd, const char *bin, unsigned int size)
{
write (fd, bin, size) ;
}

/*
* serialPrintf:
* Printf over Serial
*********************************************************************************


+ 1
- 0
wiringPi/wiringSerial.h View File

@@ -29,6 +29,7 @@ extern void serialClose (const int fd) ;
extern void serialFlush (const int fd) ;
extern void serialPutchar (const int fd, const unsigned char c) ;
extern void serialPuts (const int fd, const char *s) ;
extern void serialPutBin (const int fd, const char *bin, unsigned int size) ;
extern void serialPrintf (const int fd, const char *message, ...) ;
extern int serialDataAvail (const int fd) ;
extern int serialGetchar (const int fd) ;


Loading…
Cancel
Save