Pārlūkot izejas kodu

Add function serialPutBin() for put binarys to serial.

Signed-off-by: Thiti Yamsung <thiti.59h@gmail.com>
pull/44/head^2
Thiti Yamsung pirms 8 gadiem
vecāks
revīzija
87c3fd0d05
2 mainītis faili ar 12 papildinājumiem un 0 dzēšanām
  1. +11
    -0
      wiringPi/wiringSerial.c
  2. +1
    -0
      wiringPi/wiringSerial.h

+ 11
- 0
wiringPi/wiringSerial.c Parādīt failu

@@ -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 Parādīt failu

@@ -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) ;


Notiek ielāde…
Atcelt
Saglabāt