OK, so where is your effort?
Remember, almost no one else here has an MSP430 to play with, so all the actual development and testing has to be done by you.
Code:
#include <stdio.h>
int main ( ) {
int RXByte;
char buffer[10];
int bufPos;
bufPos=0;
while ( (RXByte=getchar() ) != '\n' ) {
/*----------------------------------------------------
Include your code here to collect bytes into a string
check the string against a protocol string
Extract a device number if appropriate.
call the appropriate function with parameters
interpret the function return value.
assemble and send the appropriate response string
as specified in the protocol
-------------------------------------------------*/
}
}
int ledon(int x)
{
printf("ledon(%d) called\n", x);
// Include your code to
// validate correct P1.n numbers for LEDs, it is written on the circuit board
// set the port direction for the ports (without overwriting values of other ports)
// hint, uses logical operator on binary number, (in hex)
// set the appropriate port to on without overwiting states of other ports)
// return 1 for success, 0 for failure (invalid port No)
}
//----------------LED OFF --
int ledoff(int x)
{
printf("ledoff(%d) called\n", x);
// Include your code to
// validate correct P1.n numbers for LEDs, it is written on the circuit board
// set the port direction for the ports (without overwriting values of other ports)
// hint, uses logical operator on binary number, (in hex)
// set the appropriate port to off without overwiting states of other ports)
// return 1 for success, 0 for failure (invalid port No)
}
Without having to load any code onto your target board, can you make any headway at all using your desktop compiler, and a simple command line program?