Пример #1
0
/*!
 * \fn AddFlags
 *  \brief Insert AX25 flags
 *
 */
void AddFlags(AX_25 *frame,unsigned int FlagNumber,unsigned int *PosiInit){

  unsigned int Count=*PosiInit;
  unsigned int PositionInitaile=*PosiInit;
  unsigned int Endsize;
  unsigned char flagAx25=(unsigned char)AX25_Flags;
  frame->messageWithAX25Flags=pvPortCalloc(frame->MessSizeWithNoStartAndStopFlags+(FlagNumber<<1),sizeof(unsigned portCHAR));
  if(frame->MessSizeWithNoStartAndStopFlags!=0){
      strncpy((portCHAR*)frame->messageWithAX25Flags,(portCHAR*)"~",1);
      while(Count++<((FlagNumber>>1)+PositionInitaile)-1){
	  //strncat((portCHAR*)frame->messageWithAX25Flags,(portCHAR*)"~",2);
	  frame->messageWithAX25Flags[Count]=flagAx25;



      }
      frame->messageWithAX25Flags[Count]='\0';
      strncat((portCHAR*)frame->messageWithAX25Flags,(portCHAR*)frame->messageBitStuffedBeforeTX,frame->MessSizeWithNoStartAndStopFlags);

      //PosiInit=Count+frame->MessSizeWithNoStartAndStopFlags+1;
      Count=strlen((portCHAR*)frame->messageWithAX25Flags);
      Endsize=Count+(FlagNumber>>1)+1;
      frame->messageWithAX25Flags[Count]='\0';
      strcat((portCHAR*)frame->messageWithAX25Flags,(portCHAR*)"~");
      while(Count++<=Endsize){
	  frame->messageWithAX25Flags[Count]=flagAx25;
      }
      frame->MessSizeNoNrzi=Count;
  }
Пример #2
0
void *pvPortZalloc(size_t size)
{
     return pvPortCalloc(1, size);	
}
Пример #3
0
void *calloc(size_t count, size_t nbytes)
{
	return pvPortCalloc(count, nbytes, mem_debug_file, 0);
}
Пример #4
0
void *pvPortZalloc(size_t size, const char * file, unsigned line)
{
     return pvPortCalloc(1, size, file, line);
}