owamp/protocol.c
/*
 * Function:        _OWPEncodeSlot
 *
 * Description:        
 *         This function is used to encode a slot record in a single block
 *         in the format needed to send a slot over the wire.
 *
 * In Args:        
 *
 * Out Args:        
 *
 * Scope:        
 * Returns:        
 * Side Effect:        
 */
_OWPEncodeSlot
Description:
This function is used to encode a slot record in a single block
in the format needed to send a slot over the wire.

In Args.

Out Args.

Side Effect.
_OWPEncodeSlot Description : This function is used to encode a slot record in a single block in the format needed to send a slot over the wire . In Args . Out Args . Side Effect .
OWPErrSeverity
_OWPEncodeSlot(
        uint32_t   msg[4], 
        OWPSlot     *slot
        )
{
    char            *buf = (char *)msg;
    OWPTimeStamp    tstamp;
    memset(buf,0,16);
    switch(slot->slot_type){
        case OWPSlotRandExpType:
            buf[0] = 0;
            tstamp.owptime = slot->rand_exp.mean;
            break;
        case OWPSlotLiteralType:
            buf[0] = 1;
            tstamp.owptime = slot->literal.offset;
            break;
        default:
            return OWPErrFATAL;
    }
    _OWPEncodeTimeStamp((uint8_t *)&buf[8],&tstamp);
    return OWPErrOK;
}
OWPErrSeverity _OWPEncodeSlot ( uint32_t msg [ 4 ] , OWPSlot * slot ) { char * buf = ( char * ) msg ; OWPTimeStamp tstamp ; memset ( buf , 0 , 16 ) ; switch ( slot -> slot_type ) { case OWPSlotRandExpType : buf [ 0 ] = 0 ; tstamp . owptime = slot -> rand_exp . mean ; break ; case OWPSlotLiteralType : buf [ 0 ] = 1 ; tstamp . owptime = slot -> literal . offset ; break ; default : return OWPErrFATAL ; } _OWPEncodeTimeStamp ( ( uint8_t * ) & buf [ 8 ] , & tstamp ) ; return OWPErrOK ; }
Function:        _OWPEncodeSlot
 Description:
         This function is used to encode a slot record in a single block
         in the format needed to send a slot over the wire.
Function : _OWPEncodeSlot Description : This function is used to encode a slot record in a single block in the format needed to send a slot over the wire .
/* 1 block 32bit aligned */ /*
     * Initialize block to zero
     */