develop a c/c++ windows console application to detect db9 serial pin changes and set pin high/low status - technology explained and source code example provided
Бюджет $30-250 USD
os: windows 10 / 64 bits
application name: [login to view URL]
argument: com<port number> (case unsensitive)
Application core (example in attached [login to view URL] & .h c++ source):
The application is a loop based on windows media timer polling the serial port every milliseconds (code example attached, use of timeSetEvent api -> deprecated, to be replaced).
The serial ports are opened and closed with CreateFile and CloseHandle apis.
The port pin status are read with GetCommModemStatus api and set with EscapeCommFunction api. All algorithms and api parameter are used in attached source code.
system time in ms: GetTickCount() api
The application communicates thru standard input/output as follow (still case unsensitive):
- quit, bye, exit: ends loop and close console. Return sttus: 0 (exit(0))
- S(et),<pin number>,<value: 0 means low state, not 0 means high state, range 0x00 to 0xFF>: change pin state
Ex: s,1,1: set serial port pin 1 to high state
- G(et),<pin number>: returns pin state on standard output
Ex: g,8: returns pin 8 status with following syntax
- P(in),<pin number>,<system date/time in ms>,value: 0 or 1>
Ex: p,8,85412001212,0
- when a pin status changes: C(hange),<pin number>,<system date/time in ms>,<value>
Ex: c,7,5248554170,0: pin 7 state changed to 0
In case of error: print on standard output: error,<reason>, then exit(1) console.
- r : reset idle statusIdleStatus is an int used as mask to detect pin changes (see ResetIdle() in attached source code)
Usage example:
serialpiner com5: starts application and starts com5 management.
in case of error: print error:<error reason>
exit(1)
if no error:
s,2,1: set output pin 2 to high
g,2,1: get output pin 2 status
p,2,2565448,1: returns pin status 2 with date/time
c,3,2566954,0: input pin 3 status change detected to low
quit: ends session, exit(0)
Environment:
visual c/c++
Serial port pinout:
[login to view URL]
How to test:
usb/serial adapter + strap between pin 5 and input pin
voltmeter for output pins (1,2,6,8,9)
Поручен:
Hi. I'm professional programmer/electronic hardware developer with experience over 20 years and I know very well RS232 protocol and it's physical layer. I can write this program. Regards, Alex.
13 фрилансеров(-а) в среднем готовы выполнить эту работу за $189
Dear sir. Your project attracted my attention at first glance, because I've extensive experience in C++ & Engineering Programming. I'm really confident about your project, and very eager to join your project. If we Больше
Hi, I did this kind of apps in past. Can help you on your task. I'm experienced C++ developer and have worked with RS232 on Windows in past. Thanks.
Hi Good hands on serial communication, UART, parsing it with state machine. I have rich experience on embedded system program including the NXP [login to view URL] series. I faced the same problem with you. Even I have the Больше
am Senior Embedded Systems & C/C++ developer. Developer expert on VC++, Eclipse Mars for C/C++, gcc,g++ in Win and Linux. OpenGL, OpenCV, Cuda. Developer expert on low level programing on C/C++. Expert on PIC, ATM Больше
Greeting. I am YinWang. I have rich embedded development experiences. I am very interesting in your project. I really hope to work with you. This project is very appreciated in my skill. regards.
Hi there, I used to deal with com ports in the past and now Im developing raspberry pi apps controlling IO ports like button switching and on/off led pins. I can develop your project in time within budget. Why dont w Больше
Hello, I can do it. I have a good experience with working serial ports. So your job is very likely to me.