Main Page   File List  

WriteRequest.h

00001 //  Write Request - indicate a string has entered GBI.
00002 //     This string would be copied into "in_string" before
00003 //     it is sent down to L2CAP.
00004 
00005         if(Input_Enabled()) { 
00006                 if(connection_established){
00007                 /* Send Set_Post(1) to NET module if connection established  - again 
00008                         Set_Post(1); */
00009 
00010                         /* print to analysis window 
00011                         if(IsMaster_Value())
00012                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -connection_established ->sent [Set_Post(1)] to NET %_END_");
00013                         else
00014                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -connection_established ->sent [Set_Post(1)] to NET %_END_");
00015                         */
00016                 /* Input -- "String" -- from the NET module. */
00017            
00018                     int j;
00019                         /* Put input string in a String variable b4 it's encapsulated in READ */
00020                         strcpy(in_String, Input_Value());
00021                                 
00022                         /* print to analysis window */
00023                         if(IsMaster_Value())
00024                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI <-received [%s] from NET!!! %_END_", in_String);
00025                         else
00026                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI <-received [%s] from NET!!! %_END_", in_String);
00027 
00028                         /* Should put string into packet and send it with White_sth.... */
00029                         /* Setup Packet for Data Write - Set Tag for Write_Union_Request and Contents. */
00030                         L2CA_packet_out.Service.__unionTag = L2CA_Service_Union_Write_tag;
00031                         L2CA_packet_out.Service.__union.Write.__unionTag = L2CA_Write_Union_Request_tag;
00032         
00033                         L2CA_packet_out.SourceID = 0x02; /* vccUnsigned8 */
00034                         L2CA_packet_out.Service.__union.Write.__union.Request.CID = CID; /*Channel ID */
00035                         L2CA_packet_out.Service.__union.Write.__union.Request.Length = strlen(in_String); /* Size in bytes of the buffer where data to be transmitted are stored */
00036 
00037                         for(j = 0; j < strlen(in_String); j++){
00038                                 L2CA_packet_out.Service.__union.Write.__union.Request.OutBuffer[j] = in_String[j];
00039                         }
00040                 
00041                         L2CA_Packet_Out_Post(&L2CA_packet_out);
00042 
00043                         /* print to analysis window */
00044                         if(IsMaster_Value())
00045                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI ->sent [Write_Request] + String : %s %_END_", in_String);
00046                         else
00047                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI ->sent [Write_Request] + String : %s %_END_", in_String);
00048                 }
00049     }/*end of Input_Enabled() */
00050 

Generated on Sat May 11 21:11:08 2002 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002