UML State Machine C
$250-750 USD
Betalades vid leverans
We have a stream of Hex data that needs to be decoded and then a decision made on what to do next. The data is received as a single byte. A loop will be the receipt of a byte. The code must be written in C because it will be integrated into an already active microcontroller code.
There will be an input section, verification and then an output section. There must be a variable to set the unit number as well. Entry into the code could be something like this
Void SerialDataEntry( int MyData ) = That I will use as the entry into the state diagram.
intUnitNumber = 1 - 16. I will set this before I call the procedure.
Int ReceiveDerialData( void ) = I use this to check if data is available. Please use -1 to indicate no data is present.
Char GetState( void ) = Get the state that we in or read the state variable
There will be 4 states
BLOCK
PASS
TAG
SWITCHINFO
BULK
AA BB 01 00 00 09 F6 AA BB 02 00 00 11 EE FF AB BB 01 01 A1 A2 A3 etc
The commands that are embedded into the string would be
AA BB 01
AB BB 01 01
AC BB 01
AD BB 01
The first byte is the main command identifier
AA = SwitchLoop
AB = Read Tag
AC = Chek Main Switch
AD = Get Status
The second part, BB, of the command sequence is just a conformation of the fact that it is a command/ If the next byte is not a BB the vyte will be passed through the system as a normal byt ie
Input AA BB 01 A1 A2
Output A1 A2
Or
Input AA 01 FF 3C
Output AA 01 FF 3C
The third is a number only sequence that can be between 1 and 16 for AA, AC and AD and 1 and 16 and 1 and 2 for AB.
I will send an AA and read the result and check the state. The state machine must check that it's a command char (AA, AB, AC, AD) and remember that it's a potential command but keep from sending it back. I will read the output and see its -1 and the state and do nothing.
I send BB. The state machine sees that this definitely a command character and get ready to change its state. Now it will look for a number between 1 and 16.
I send 1. The state machine will see that this is a command and will check if its for this unit. If the variable I set is the same as the one I set then the state will change to PASS and any new char I send will be returned to me. If its not the same the bytes will be discarded because its a command char even though not for this [login to view URL] bytes are discarded in any case.
I now send the 00, When I read i will get the 00 then I can send it down the line.
All characters from this point will be send through until a command byte is received. (AA, AB, AC, AD).
Command AB will set the state to TAG, AC to switch info and AD to bulk.
Any control characters that is received and blocked without the other is passed through ie 01 AA 02 will be passed through as BB 01 AA or BB AA. Its only the exact sequence that has to be read and blocked.
Sample input and output for unit will will be
Input
AA BB 01 00 00 09 F6 AA BB 02 00 00 11 EE FF AB BB 01 01 A1 A2 A3 etc
Output
00 00 09 F6
Projekt-id: #34061826
About the project
Tilldelades:
14 frilansare har lagt bud på i genomsnitt $830 för det här jobbet
Hello there. I have good experience with c programming and can help your project. So if u choose me, you will get best result. i am embedded expert. Hope u choose me. Regards.
Hello, An interesting task. Ready to make this parser with state machine, in accordance with your requirements. In C code, given that it will be for the controller. With testing on simulated units.
Hi there, ★★★ C / C++ / C# Expert ★★★ 5+ Years of Experience ★★★ I've read requirements and ready to work on your project. I have strong grasp on Object-Oriented Programming along with excellent analytical and program Mer
I am expert of C programme I understood your requirements but I have a few doubts, text me so I can clear all my doubts right away
I have good knowledge of state machine programming using c language. We need to work together to meet your requirements
hi, this is Nasir Mehmood. I am a software engineer and have more than 20 years of development experience in embedded systems, database design, web design, graphics, and mobile applications. i have extensive knowledge Mer
I have thoroughly gone through your project description, I'm an expert and I can help you. Kindly send me a message I'm a senior engineer with rich experience in C Programming, Microcontroller. I am a Python developer Mer
Hello there. Expert is here. Pls contact me. Let's have deep discussion about your project. Thanks.