Beispiel #1
0
void *dmr_call_start_hook(char *pkt){
  /* This hook handles the dmr_contact_check() function, calling
     back to the original function where appropriate.

     It is called several times per call, presumably when the
     addresses are resent for late entry.  If you need to trigger
     something to happen just once per call, it's better to put that
     in dmr_call_end_hook().

     pkt looks like this:

     overhead
     /    /         /--dst-\ /--src-\
     08 1a 00 00 00 00 00 63 30 05 54 73 e3 ae
     10 00 00 00 00 00 00 63 30 05 54 73 2c 36
   */

  //Destination adr as Big Endian.
  int dst=(pkt[7]|
           (pkt[6]<<8)|
	   (pkt[5]<<16));

  int src=(pkt[10]|
           (pkt[9]<<8)|
           (pkt[8]<<16));



//  OSSemPend(debug_line_sem, 0, &err);
//
  //printf("Call start %d -> %d\n", src,dst);
//  sprintf(DebugLine1, "%d -> %d", src, dst );

//  if( find_dmr_user(DebugLine2, src, (void *) 0x100000, 80) == 0){
//    sprintf(DebugLine2, ",ID not found,in users.csv,see README.md,on Github");   // , is line seperator ;)
//  }

//  OSSemPost(debug_line_sem);

  int primask=OS_ENTER_CRITICAL();
  g_dst=dst;
  g_src=src;
  OS_EXIT_CRITICAL(primask);
    


  //This prints a dot at every resynchronization frame.
  //It can distract AMBE2+ logging.
  //printf(".");

  //Record that we are in a call, for later logging.
  incall=1;

  //Forward to the original function.
  return dmr_call_start(pkt);
}
Beispiel #2
0
void *dmr_call_start_hook(char *pkt){
  /* This hook handles the dmr_contact_check() function, calling
     back to the original function where appropriate.
     
     It is called several times per call, presumably when the
     addresses are resent for late entry.  If you need to trigger
     something to happen just once per call, it's better to put that
     in dmr_call_end_hook().
     
     pkt looks like this:
     
     overhead
     /    /         /--dst-\ /--src-\
     08 1a 00 00 00 00 00 63 30 05 54 73 e3 ae
     10 00 00 00 00 00 00 63 30 05 54 73 2c 36
   */
  
  //Destination adr as Big Endian.
  int dst=(pkt[7]|
	   (pkt[6]<<8)|
	   (pkt[5]<<16));
  
  //All but the top row is overwritten,
  //so any status has to be logged here.
  char buf[15];
  
  //Print the target adress to the screen.
  sprintf(buf,
	  "%d",dst);
  drawascii(buf,
	    160,20);
  
  //Just a dot for logging.
  printf(".");
  
  //Record that we are in a call, for later logging.
  incall=1;
  
  //Forward to the original function.
  return dmr_call_start(pkt);
}