Main Page   File List   File Members  

SlipMootooth_GBI_wht_c_nt.h

00001 // The full source file of GBI (Game Bluetooth Interface).
00002 
00007 
00008 
00025 #include "white_interface.h"
00026 
00039 unsigned int strlen (const char *s);  
00040 
00056 char * strcpy (char *to, const char *from); 
00057 
00058 /* Function Prototypes. */
00067 void connect(void); 
00068 
00069 int vccPrintPdxDebugInfo(const char *format, ...); 
00070 
00071 /* Global Variables */
00072 /* Packets */
00078 L2CA_Packet L2CA_packet_out; 
00079 
00091 L2CA_Packet *L2CA_packet_in; 
00092 
00095 L2CA_Packet L2CA_packet;     
00096 
00097 /* Flag FLAG to make sure the connect() function is initialised only once */
00102 int FLAG = 1; 
00103 
00104 /* Strings */
00110 char in_String[20]; 
00111 
00115 char out_String[20];     
00116 
00117 /* Connection stuff */
00126 int connected;    
00127         
00137 int configured;   
00138 
00155 int connection_established; 
00156 
00157 /* Service Primitive Events' specifics */
00158 TBluetoothDeviceAddress BD_ADDR;     
00159 ID_t Identifier = 0x00;              
00160 CID_t CID = 0x00;                    
00161 Response_t L2CA_response = 0x0;      
00162 Status_t status = 0x0;               
00163 OutMTU_t OutMTU = 0x0;               
00164 vccUnsigned32 TokenRate = 0x0;       
00165 vccUnsighed32 TokenBucketSize = 0x0; 
00166 vccUnsighed32 PeakBandwidth = 0x0;   
00167 vccUnsigned32 Latency = 0x0;         
00168 vccUnsighed32 DelayVariation = 0x0;  
00169 
00170 /* For Read */
00171 Result_t Result = 0x0;     
00172 N_t N = 0x0;               
00173 
00174 /* Support Function */
00175 void connect(void) {
00176         /* Print out which device is receiving the String from NET module!! */
00177         if(IsMaster_Value())
00178                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -connect() FIRST CONNECT_REQUEST to LL %_END_");
00179         else
00180                 vccPrintPdxDebugInfo("%_START_ SLAVE  : SHOULDN'T GET HERE!!! %_END_");
00181 
00182     /*L2CA_Packet L2CA_packet_out;*/
00183         /* Prepare Connection Request Tag and Contents. */
00184         L2CA_packet_out.Service.__unionTag = L2CA_Service_Union_Connect_tag;
00185         L2CA_packet_out.Service.__union.Connect.__unionTag = L2CA_Connect_Union_Request_tag;
00186 
00187         L2CA_packet_out.SourceID = 0x02;
00188         L2CA_packet_out.Service.__union.Connect.__union.Request.PSM = 0x3; /* Target PSM provided for the connection */
00189         
00190         L2CA_packet_out.Service.__union.Connect.__union.Request.BD_ADDR.LAP = 0x123456;
00191         L2CA_packet_out.Service.__union.Connect.__union.Request.BD_ADDR.UAP = 0x12;
00192         L2CA_packet_out.Service.__union.Connect.__union.Request.BD_ADDR.NAP = 0x0;
00193         
00194         /* Send packet to LL and other device. */
00195         L2CA_Packet_Out_Post(&L2CA_packet_out);
00196 
00197          /* Print out which device is receiving the String from NET module!! */
00198         if(IsMaster_Value())
00199                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -connect() ->sent [ConnectRequest] to LL %_END_");
00200         else
00201                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -connect() SHOULDN't GET HERE!!! %_END_");
00202 } 
00203 
00204 /* Init Function */
00209 void poin_entry_Init() {                   
00210         /*print usefull messages */
00211         if(IsMaster_Value()) 
00212                 vccPrintPdxDebugInfo("Master : Entered GBI poin_entry_Init()\n");
00213         else
00214                 vccPrintPdxDebugInfo("Slave  : Entered GBI poin_entry_Init()\n");
00215 
00216         /* Initialise global variables */
00217         connected = 0;
00218         configured = 0;
00219         connection_established = 0;
00220 }  
00221 
00222 /* Run Function */
00262 void poin_entry_Run() {
00263         /* print useful message to analysis window. */
00264         if(IsMaster_Value())
00265                 vccPrintPdxDebugInfo("%_START_ Master : Entered GBI poin_entry_Run() %_END_");
00266         else
00267                 vccPrintPdxDebugInfo("%_START_ Slave  : Entered GBI poin_entry_Run() %_END_");
00268 
00269         /* Should only get here once, don't really has any actions, just to start poin_entry_Run()!! */
00270         if(Start_Run_Enabled()) {               
00271                 /*print usefull messages */
00272                 if(IsMaster_Value()) 
00273                         vccPrintPdxDebugInfo("%_START_ Master : Start_Run_Enabled!!! %_END_");
00274                 else
00275                         vccPrintPdxDebugInfo("%_START_ Slave  : Start_Run_Enabled!!! %_END_");
00276         }
00277 
00278         /*If is Master, send connect() for once only and set FLAG to 0!!! */ 
00279         if(FLAG) {
00280                 if(IsMaster_Value()) {
00281         
00282                         /*print usefull messages */
00283                         if(IsMaster_Value()) 
00284                                 vccPrintPdxDebugInfo("%_START_ Master : Entered GBI _Run() - ONLY CONNECT()!!!!! %_END_");
00285                         else    
00286                                 vccPrintPdxDebugInfo("%_START_ Slave  : Shouldn't get here for connection!! %_END_");
00287 
00288                         FLAG = 0; /* False */
00289                         connect();
00290                 }
00291         }
00292 
00293         if(Input_Enabled()) { 
00294                 if(connection_established){
00295                 /* Input -- "String" -- from the NET module. */
00296                         int j;
00297                         
00298                         /* Put input string in a String variable b4 it's encapsulated in READ */
00299                         strcpy(in_String, Input_Value());
00300                                 
00301                         /* print to analysis window */
00302                         if(IsMaster_Value())
00303                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI <-received [%s] from NET!!! %_END_", in_String);
00304                         else
00305                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI <-received [%s] from NET!!! %_END_", in_String);
00306 
00307                         /* Should put string into packet and send it with White_sth.... */
00308                         /* Setup Packet for Data Write - Set Tag for Write_Union_Request and Contents. */
00309                         L2CA_packet_out.Service.__unionTag = L2CA_Service_Union_Write_tag;
00310                         L2CA_packet_out.Service.__union.Write.__unionTag = L2CA_Write_Union_Request_tag;
00311         
00312                         L2CA_packet_out.SourceID = 0x02; /* vccUnsigned8 */
00313                         L2CA_packet_out.Service.__union.Write.__union.Request.CID = CID; /*Channel ID */
00314                         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 */
00315 
00316                         for(j = 0; j < strlen(in_String); j++){
00317                                 L2CA_packet_out.Service.__union.Write.__union.Request.OutBuffer[j] = in_String[j];
00318                         }
00319                 
00320                         L2CA_Packet_Out_Post(&L2CA_packet_out);
00321 
00322                         /* print to analysis window */
00323                         if(IsMaster_Value())
00324                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI ->sent [Write_Request] + String : %s %_END_", in_String);
00325                         else
00326                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI ->sent [Write_Request] + String : %s %_END_", in_String);
00327                 }
00328     }/*end of Input_Enabled() */
00329 
00330     /* do something...-request|confirmation|indication|response...*/
00331         L2CA_packet_in = L2CA_Packet_In_Value();
00332         L2CA_packet = *L2CA_packet_in;
00333 
00334         switch(L2CA_packet_in->Service.__unionTag) {
00335                 case L2CA_Service_Union_Indication_tag: {
00336                         switch(L2CA_packet_in->Service.__union.Indication.__unionTag) {
00337                                 case L2CA_Indication_Union_ConnectInd_tag: {
00338                                 /*Receive ConnectInd - return ConnectResponse */
00339 
00340                                         /*Print useful message to Analysis Output window */
00341                                         if(IsMaster_Value())
00342                                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI <-received [ConnectInd] from LL - return ConnectResponse %_END_");
00343                                         else
00344                                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI <-received [ConnectInd] from LL - return ConnectResponse %_END_");
00345 
00346                                         /*TBluetoothDeviceAddress * toAddress = ConnectToAddress_Value();*/
00347 
00348                                         /*Have been sent ConnectIndication reply with L2CA_ConnectRsp */
00349                                         Identifier = L2CA_packet_in->Service.__union.Indication.__union.ConnectInd.Identifier;
00350                                         CID        = L2CA_packet_in->Service.__union.Indication.__union.ConnectInd.CID;
00351                                         BD_ADDR    = L2CA_packet_in->Service.__union.Indication.__union.ConnectInd.BD_ADDR; 
00352                                 
00353                                         /* Prepare L2CA_packet_out - set Tag and Contents. */
00354                                         L2CA_packet_out.Service.__unionTag = L2CA_Service_Union_ConnectResponse_tag;
00355                                         L2CA_packet_out.Service.__union.ConnectResponse.__unionTag = L2CA_ConnectResponse_Union_Response_tag;
00356 
00357                                         L2CA_packet_out.SourceID = 0x02;
00358                                         L2CA_packet_out.Service.__union.ConnectResponse.__union.Response.BD_ADDR = BD_ADDR;
00359                                         L2CA_packet_out.Service.__union.ConnectResponse.__union.Response.LCID = CID;
00360                                         L2CA_packet_out.Service.__union.ConnectResponse.__union.Response.Response = L2CA_response;
00361                                         L2CA_packet_out.Service.__union.ConnectResponse.__union.Response.Status = status;
00362 
00363                                         L2CA_Packet_Out_Post(&L2CA_packet_out);
00364                                         
00365                                         /*Print useful message to Analysis Output window */
00366                                         if(IsMaster_Value())
00367                                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI ->sent [ConnectResponse] to LL %_END_");
00368                                         else
00369                                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI ->sent [ConnectResponse] to LL %_END_");
00370 
00371                                         /* Slave is "connected" */
00372                                         connected = 1;
00373 
00374                                         /*Print useful message to Analysis Output window */
00375                                         if(IsMaster_Value())
00376                                                 vccPrintPdxDebugInfo("%_START_ MASTER : Master should never get here!!! %_END_");
00377                                         else
00378                                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -ConnectInd --- #connected = 1# %_END_");
00379 
00380                                         break;
00381                                 }
00382                                 case L2CA_Indication_Union_ConfigInd_tag: {
00383                                                 
00384                                         /*Print useful message to Analysis Output window */
00385                                         if(IsMaster_Value())
00386                                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI <-received [ConfigInd] from LL - return ConfigResponse %_END_");
00387                                         else
00388                                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI <-received [ConfigInd] from LL - return ConfigResponse %_END_");
00389                                         
00390                                         /* Have been sent ConfigInd reply with L2CA_ConfigRsp */
00391                                         CID             = L2CA_packet_in->Service.__union.Indication.__union.ConfigInd.CID; 
00392                                         OutMTU          = L2CA_packet_in->Service.__union.Indication.__union.ConfigInd.OutMTU;
00393                                         TokenRate       = L2CA_packet_in->Service.__union.Indication.__union.ConfigInd.InFlow.TokenRate;
00394                                         TokenBucketSize = L2CA_packet_in->Service.__union.Indication.__union.ConfigInd.InFlow.TokenBucketSize;
00395                                         PeakBandwidth   = L2CA_packet_in->Service.__union.Indication.__union.ConfigInd.InFlow.PeakBandwidth;
00396                                         Latency         = L2CA_packet_in->Service.__union.Indication.__union.ConfigInd.InFlow.Latency;
00397                                         DelayVariation  = L2CA_packet_in->Service.__union.Indication.__union.ConfigInd.InFlow.DelayVariation;
00398 
00399                                         /* Prepare for ConfigurationResponse! Set Tag and Contents. */
00400                                         L2CA_packet_out.Service.__unionTag = L2CA_Service_Union_ConfigurationResponse_tag;
00401                                         L2CA_packet_out.Service.__union.ConfigurationResponse.__unionTag = L2CA_ConfigurationResponse_Union_Response_tag;
00402         
00403                                         L2CA_packet_out.SourceID = 0x02;
00404                                         L2CA_packet_out.Service.__union.ConfigurationResponse.__union.Response.CID = CID;
00405                                         L2CA_packet_out.Service.__union.ConfigurationResponse.__union.Response.OutMTU = OutMTU;
00406                                         L2CA_packet_out.Service.__union.ConfigurationResponse.__union.Response.InFlow.TokenRate = TokenRate;
00407                                         L2CA_packet_out.Service.__union.ConfigurationResponse.__union.Response.InFlow.TokenBucketSize = TokenBucketSize;
00408                                         L2CA_packet_out.Service.__union.ConfigurationResponse.__union.Response.InFlow.PeakBandwidth = PeakBandwidth;
00409                                         L2CA_packet_out.Service.__union.ConfigurationResponse.__union.Response.InFlow.Latency = Latency;
00410                                         L2CA_packet_out.Service.__union.ConfigurationResponse.__union.Response.InFlow.DelayVariation = DelayVariation;
00411 
00412                                         L2CA_Packet_Out_Post(&L2CA_packet_out);
00413 
00414                                         /*Print useful message to Analysis Output window */
00415                                         if(IsMaster_Value())
00416                                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI ->sent [ConfigResponse] to LL %_END_");
00417                                         else
00418                                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI ->sent [ConfigResponse] to LL %_END_");
00419 
00420                                         /* Setup L2CAP for Data Read - Set Tag and Contents. */
00421 
00422                                         L2CA_packet_out.Service.__unionTag = L2CA_Service_Union_Read_tag;
00423                                         L2CA_packet_out.Service.__union.Read.__unionTag = L2CA_Read_Union_Request_tag;
00424                 
00425                                         L2CA_packet_out.SourceID = 0x02;
00426                                         L2CA_packet_out.Service.__union.Read.__union.Request.CID = CID; /*0x05;*/
00427                                         L2CA_packet_out.Service.__union.Read.__union.Request.Length = 1504;
00428                                 
00429                                         L2CA_Packet_Out_Post(&L2CA_packet_out);
00430                                         
00431                                         /*Print useful message to Analysis Output window */
00432                                         if(IsMaster_Value())
00433                                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -ConfigInd ->sent [Read_Request] to LL %_END_");
00434                                         else
00435                                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -ConfigInd ->sent [Read_Request] to LL %_END_");
00436 
00437                                         configured = 1;
00438                                         
00439                                         /*Print useful message to Analysis Output window */
00440                                         if(IsMaster_Value())
00441                                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -ConfigInd --- #configured = 1# %_END_");
00442                                         else
00443                                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -ConfigInd --- #configured = 1# %_END_");
00444 
00445                                         connection_established = 1;
00446 
00447                                         /* print to analysis window */
00448                                         if(IsMaster_Value())
00449                                                 vccPrintPdxDebugInfo("%_START_ Master : GBI -ConfigIndication --- #connection_established = 1# %_END_");
00450                                         else
00451                                                 vccPrintPdxDebugInfo("%_START_ Slave  : GBI -ConfigIndication --- #connection_established = 1# %_END_");
00452 
00453                                 
00454                                         break;
00455                                 }
00456                                 /* Not use ever in this practical! */
00457                                 case L2CA_Indication_Union_DisconnectInd_tag: {
00458                                         break;
00459                                 }
00460 
00461                                 default:
00462                                         vccPrintPdxDebugInfo("%_START_ Error: default case in Service->Indication switch reached %_END_");
00463                                         break;
00464                         }
00465                         break;
00466                 }
00467                 case L2CA_Service_Union_Connect_tag: {
00468                         CID = L2CA_packet_in->Service.__union.Connect.__union.Confirm.LCID;
00469 
00470                         /*Print useful message to Analysis Output window */
00471                         if(IsMaster_Value())
00472                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI <-received [ConnectConfirm] from LL - return ConfigRequest %_END_");
00473                         else
00474                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI <-received [ConnectConfirm] from LL - return ConfigRequest %_END_");
00475 
00476                         /* Prepare Configure_Union_Request! - Set Tag and Contents. */
00477                         L2CA_packet_out.Service.__unionTag = L2CA_Service_Union_Configure_tag;
00478                         L2CA_packet_out.Service.__union.Configure.__unionTag = L2CA_Configure_Union_Request_tag;
00479                         
00480                         L2CA_packet_out.SourceID = 0x02;
00481                         L2CA_packet_out.Service.__union.Configure.__union.Request.CID = CID;
00482                         L2CA_packet_out.Service.__union.Configure.__union.Request.InMTU = 0x2A0;
00483                         L2CA_packet_out.Service.__union.Configure.__union.Request.OutFlow.TokenRate = 0x00;
00484                         L2CA_packet_out.Service.__union.Configure.__union.Request.OutFlow.TokenBucketSize = 0x00;
00485                         L2CA_packet_out.Service.__union.Configure.__union.Request.OutFlow.PeakBandwidth = 0x00;
00486                         L2CA_packet_out.Service.__union.Configure.__union.Request.OutFlow.Latency = 0x00;
00487                         L2CA_packet_out.Service.__union.Configure.__union.Request.OutFlow.DelayVariation = 0x00;
00488                         L2CA_packet_out.Service.__union.Configure.__union.Request.OutFlushTO = 0x1;
00489                         L2CA_packet_out.Service.__union.Configure.__union.Request.LinkTO = 0x7d0;
00490 
00491                         L2CA_Packet_Out_Post(&L2CA_packet_out);
00492 
00493                         /*Print useful message to Analysis Output window */
00494                         if(IsMaster_Value())
00495                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI ->sent [ConfigRequest] to LL %_END_");
00496                         else
00497                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI ->sent [ConfigRequest] to LL %_END_");
00498 
00499                         break;
00500                 }
00501                 case L2CA_Service_Union_Configure_tag: {
00502                         /* Configuration Confirm. */
00503 
00504                         /*Print useful message to Analysis Output window */
00505                         if(IsMaster_Value())
00506                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI <-received [ConfigureConfirm] from LL - return Read_Request %_END_");
00507                         else
00508                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI <-received [ConfigureConfirm] from LL - return Read_Request %_END_");
00509 
00510                         /* Setup L2CAP for Data Read - Set Tag for Read_Union_Request and Contents. */
00511                         L2CA_packet_out.Service.__unionTag = L2CA_Service_Union_Read_tag;
00512                         L2CA_packet_out.Service.__union.Read.__unionTag = L2CA_Read_Union_Request_tag;
00513         
00514                         L2CA_packet_out.SourceID = 0x02;
00515                         L2CA_packet_out.Service.__union.Read.__union.Request.CID = CID; /* 0x05; */
00516                         L2CA_packet_out.Service.__union.Read.__union.Request.Length = 1504;
00517                                 
00518                         L2CA_Packet_Out_Post(&L2CA_packet_out);
00519 
00520                         /*Print useful message to Analysis Output window */
00521                         if(IsMaster_Value())
00522                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -Configure ->sent [Read_Request] to LL %_END_");
00523                         else
00524                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -Configure ->sent [Read_Request] to LL %_END_");
00525 
00526                         /* Master is configured". */
00527                         configured = 1;
00528                         
00529                         /*Print useful message to Analysis Output window */
00530                         if(IsMaster_Value())
00531                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -Configure --- #configured = 1# %_END_");
00532                         else
00533                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -Configure --- #configured = 1# %_END_");
00534 
00535                         /* Set connectin_established = 1 after Read_Request is sent after receiving Configure Confirm!! */
00536                         connection_established = 1;
00537                         
00538                         /* print to analysis window */
00539                         if(IsMaster_Value())
00540                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -Configure --- #connection_established = 1# %_END_");
00541                         else
00542                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -Configure --- #connection_established = 1# %_END_");
00543 
00544                         /* Only one called by Master AFTER configured and connection_established, to call GBI-Test for String !!! */
00545                         /* Master would call this before Slave! Therefore, maybe the "Master" player will make the first move!!*/
00546                         Set_Post(1);
00547 
00548                         /* print to analysis window */
00549                         if(IsMaster_Value())
00550                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -ConfigInd ->sent [Set_Post(1)] to NET %_END_");
00551                         else
00552                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -ConfigInd ->sent [Set_Post(1)] to NET %_END_");
00553                 
00554                         break;
00555                 }
00556                 case L2CA_Service_Union_Read_tag: {
00557                         int i;
00558                          /*[jtt] Check if Read Confirm(Should be!!!), (from L2CAP)
00559                                 1)Extract String from Payload, 
00560                                 2)Put it into "out_String" variable,
00561                                 3)Put "out_String" into "Output_Post(out_String);" and sent it!
00562                                 4)Last prepare for another 'Read Request' command and send it to L2CAP.
00563                                   by setting up the "tag" part and do "L2CA_Packet_Out_Post(&L2CA_Packet_out);" 
00564                          */
00565 
00566                         /*Print useful message to Analysis Output window */
00567                         if(IsMaster_Value())
00568                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI ->received [Read_Confirm] from LL - return Read_Request %_END_");
00569                         else
00570                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI ->received [Read_Confirm] from LL - return Read_Request %_END_");
00571 
00572                     /*Receives ReadCfm(meaning a Write on the other device), reply with L2CA_Read_Union_Request_tag */
00573                         /* Output Parameters - Result and N */
00574                         Result     = L2CA_packet_in->Service.__union.Read.__union.Result.Result;/*0x0000=Success, 0x0001=Unsuccessful */
00575                         N          = L2CA_packet_in->Service.__union.Read.__union.Result.N; /*no. of bytes transferred to InBuffer */
00576                         
00577                         /* Read string from InBuffer and store it into out_String. */
00578                         for(i = 0; i < N; i++){
00579                                 out_String[i] = L2CA_packet_in->Service.__union.Read.__union.Result.InBuffer[i]; /* Integer[2000] */
00580                         }               
00581                         out_String[N] = 0;
00582 
00583                         /*3 - send String to NET module */
00584                         Output_Post(out_String);
00585 
00586                         /*Print useful message to Analysis Output window */
00587                         if(IsMaster_Value())
00588                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -Read ->sent [%s] to NET %_END_", out_String);
00589                         else
00590                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -Read ->sent [%s] to NET %_END_", out_String);
00591 
00592                         /*4 - from L2CA_Service_Union_Configure_tag above*/
00593                         /* Setup L2CAP for Data Read - Set Tag for Read_Union_Request and Contents. */
00594                         L2CA_packet_out.Service.__unionTag = L2CA_Service_Union_Read_tag;
00595                         L2CA_packet_out.Service.__union.Read.__unionTag = L2CA_Read_Union_Request_tag;
00596         
00597                         L2CA_packet_out.SourceID = 0x02;
00598                         L2CA_packet_out.Service.__union.Read.__union.Request.CID = CID;  /* 0x05 */
00599                         L2CA_packet_out.Service.__union.Read.__union.Request.Length = 1504;
00600                                 
00601                         L2CA_Packet_Out_Post(&L2CA_packet_out);
00602         
00603                         /*Print useful message to Analysis Output window */
00604                         if(IsMaster_Value())
00605                                 vccPrintPdxDebugInfo("%_START_ MASTER : GBI -Read ->sent [Read_Request] to LL %_END_");
00606                         else
00607                                 vccPrintPdxDebugInfo("%_START_ SLAVE  : GBI -Read ->sent [Read_Request] to LL %_END_");
00608 
00609                         break;
00610                 }
00611                 case L2CA_Service_Union_Write_tag: {
00612                         /* Write Confirm neglected. */
00613                         break;
00614                 }
00615         default:
00616                         vccPrintPdxDebugInfo("%_START_ Error: default case in Service switch reached %_END_");
00617                         break;
00618           } /*end of main switch*/
00619         }/*end of if(L2CA_Packet_In_Enabled())*/
00620 }  

Generated on Sun May 12 18:58:57 2002 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002