Commit 8253c700 authored by julien.delange's avatar julien.delange
Browse files

* po-hi-c/src/drivers/po_hi_driver_rasta_serial.c

   - delete useless debug message

 * po-hi-c/src/drivers/po_hi_driver_rasta_spacewire.c
   - delete output about communication, put it as debug message

 * po-hi-c/src/drivers/po_hi_driver_linux_serial.c
   - remove endianess conversion, convert only the port
     and let the application-level layer convert the application
     data (through ASN1 converters with TASTE).



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@1438 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent be6c67c6
......@@ -205,40 +205,15 @@ int __po_hi_c_driver_serial_linux_sender (__po_hi_task_id task_id, __po_hi_port
__po_hi_msg_reallocate (&msg);
request->port = destination_port;
__DEBUGMSG ("REQUEST vars: |");
{
int s;
int i;
uint8_t* tmp;
tmp = (uint8_t*) &(request->vars);
s = sizeof (request->vars);
for (i = 0 ; i < s ; i++)
{
printf("%x", *tmp);
tmp++;
fflush (stdout);
}
}
__DEBUGMSG ("|\n");
__po_hi_marshall_request (request, &msg);
printf ("MSG AVANT SWAP:");
__po_hi_messages_debug (&msg);
printf ("\n");
for (tmp = 0 ; tmp < __PO_HI_MESSAGES_MAX_SIZE ; tmp += 4)
{
swap_pointer = (unsigned long*) &msg.content[tmp];
swap_value = *swap_pointer;
*swap_pointer = __po_hi_swap_byte (swap_value);
}
printf ("MSG APRES SWAP:");
__po_hi_messages_debug (&msg);
printf ("\n");
n = write (po_hi_c_driver_serial_fd, &msg, __PO_HI_MESSAGES_MAX_SIZE);
/* Swap only the port (first 32 bytes) */
swap_pointer = (unsigned long*) &msg.content[0];
swap_value = *swap_pointer;
*swap_pointer = __po_hi_swap_byte (swap_value);
__DEBUGMSG ("[LINUX SERIAL] write() returns %d, sizeof (port)=%d, sizeof(vars)=%d\n", n, sizeof (request->port), sizeof (request->vars));
n = write (po_hi_c_driver_serial_fd, &msg, __PO_HI_MESSAGES_MAX_SIZE);
__DEBUGMSG ("[LINUX SERIAL] Message sent: 0x");
......
......@@ -40,8 +40,8 @@
int po_hi_c_driver_rasta_serial_fd;
__po_hi_msg_t msg;
__po_hi_request_t request;
__po_hi_msg_t __po_hi_c_driver_rasta_serial_msg;
__po_hi_request_t __po_hi_c_driver_rasta_serial_request;
void __po_hi_c_driver_serial_rasta_poller (void)
{
......@@ -51,10 +51,11 @@ void __po_hi_c_driver_serial_rasta_poller (void)
int tr;
uint8_t* ptr;
__DEBUGMSG ("[RASTA SERIAL] Hello, i'm the serial poller !\n");
__DEBUGMSG ("[RASTA SERIAL] Poller waits for incoming message !\n");
ts = __PO_HI_MESSAGES_MAX_SIZE;
tr = 0;
ptr = &(msg.content[0]);
ptr = &(__po_hi_c_driver_rasta_serial_msg.content[0]);
__po_hi_msg_reallocate (&__po_hi_c_driver_rasta_serial_msg);
while (ts > 0)
{
n = read (po_hi_c_driver_rasta_serial_fd, ptr, ts);
......@@ -74,35 +75,16 @@ void __po_hi_c_driver_serial_rasta_poller (void)
__DEBUGMSG ("[RASTA SERIAL] Message received by poller: 0x");
for (ts = 0 ; ts < __PO_HI_MESSAGES_MAX_SIZE ; ts++)
{
__DEBUGMSG ("%x", msg.content[ts]);
__DEBUGMSG ("%x", __po_hi_c_driver_rasta_serial_msg.content[ts]);
}
__DEBUGMSG ("\n");
msg.length = tr;
__po_hi_unmarshall_request (&request, &msg);
#ifdef __PO_HI_DEBUG
__DEBUGMSG ("REQUEST vars: |");
{
int s;
int i;
uint8_t* tmp;
tmp = (uint8_t*) &(request.vars);
s = sizeof (request.vars);
for (i = 0 ; i < s ; i++)
{
printf("%x", *tmp);
tmp++;
fflush (stdout);
}
}
__DEBUGMSG ("|\n");
#endif
__po_hi_c_driver_rasta_serial_msg.length = tr;
__po_hi_unmarshall_request (&__po_hi_c_driver_rasta_serial_request,
&__po_hi_c_driver_rasta_serial_msg);
__DEBUGMSG ("[RASTA SERIAL] Destination port: %d, sizeof(port)=%d, sizeof(vars)=%d\n", request.port, sizeof( request.port), sizeof (request.vars));
__po_hi_main_deliver (&request);
__po_hi_main_deliver (&__po_hi_c_driver_rasta_serial_request);
}
void __po_hi_c_driver_serial_rasta_init (__po_hi_device_id id)
......
......@@ -91,7 +91,7 @@ void __po_hi_c_driver_spacewire_rasta_poller (void)
__po_hi_unmarshall_request (&request, &msg);
printf ("[RASTA SPACEWIRE] Destination port: %d\n", request.port);
__DEBUGMSG ("[RASTA SPACEWIRE] Destination port: %d\n", request.port);
__po_hi_main_deliver (&request);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment