This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088
Fork of libMiMic by
core/utils/NyLPC_cUuid.c@48:00d211aac2ec, 2013-08-07 (annotated)
- Committer:
- nyatla
- Date:
- Wed Aug 07 13:53:02 2013 +0000
- Revision:
- 48:00d211aac2ec
- Child:
- 49:d4334acc3ec3
backup
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nyatla | 48:00d211aac2ec | 1 | #include <stdlib.h> |
nyatla | 48:00d211aac2ec | 2 | #include "NyLPC_cUuid.h" |
nyatla | 48:00d211aac2ec | 3 | |
nyatla | 48:00d211aac2ec | 4 | void NyLPC_cUuid_initialize(NyLPC_TcUuid_t* i_inst) |
nyatla | 48:00d211aac2ec | 5 | { |
nyatla | 48:00d211aac2ec | 6 | } |
nyatla | 48:00d211aac2ec | 7 | #define NyLPC_cUuid_finalize(i_inst) |
nyatla | 48:00d211aac2ec | 8 | |
nyatla | 48:00d211aac2ec | 9 | void NyLPC_cUuid_setTimeBase(NyLPC_TcUuid_t* i_inst,NyLPC_TUInt32 i_time_l,NyLPC_TUInt32 i_time_h,NyLPC_TUInt16 i_seq,struct NyLPC_TEthAddr* eth_mac) |
nyatla | 48:00d211aac2ec | 10 | { |
nyatla | 48:00d211aac2ec | 11 | i_inst->f1=i_time_l; |
nyatla | 48:00d211aac2ec | 12 | i_inst->f2=(NyLPC_TUInt16)(i_time_h & 0x0000ffff); |
nyatla | 48:00d211aac2ec | 13 | i_inst->f3=(NyLPC_TUInt16)(((i_time_h & 0x0fff0000)>>16)|0x1000); |
nyatla | 48:00d211aac2ec | 14 | i_inst->f4=(NyLPC_TUInt8)((0x3f&(i_seq>>8))|0x80); |
nyatla | 48:00d211aac2ec | 15 | i_inst->f5=(NyLPC_TUInt8)(0xff&(i_seq>>0)); |
nyatla | 48:00d211aac2ec | 16 | memcpy(i_inst->f6,eth_mac->addr,8); |
nyatla | 48:00d211aac2ec | 17 | } |
nyatla | 48:00d211aac2ec | 18 | |
nyatla | 48:00d211aac2ec | 19 | |
nyatla | 48:00d211aac2ec | 20 | void NyLPC_cUuid_toString(NyLPC_TcUuid_t* i_inst,NyLPC_TChar* i_buf) |
nyatla | 48:00d211aac2ec | 21 | { |
nyatla | 48:00d211aac2ec | 22 | NyLPC_TChar* p=i_buf; |
nyatla | 48:00d211aac2ec | 23 | NyLPC_TInt16 i; |
nyatla | 48:00d211aac2ec | 24 | NyLPC_uitoa2(i_inst->f1,p,16,8);p+=8; |
nyatla | 48:00d211aac2ec | 25 | *p='-';p++; |
nyatla | 48:00d211aac2ec | 26 | NyLPC_uitoa2(i_inst->f2,p,16,4);p+=4; |
nyatla | 48:00d211aac2ec | 27 | *p='-';p++; |
nyatla | 48:00d211aac2ec | 28 | NyLPC_uitoa2(i_inst->f3,p,16,4);p+=4; |
nyatla | 48:00d211aac2ec | 29 | *p='-';p++; |
nyatla | 48:00d211aac2ec | 30 | NyLPC_uitoa2(i_inst->f4,p,16,2);p+=4; |
nyatla | 48:00d211aac2ec | 31 | NyLPC_uitoa2(i_inst->f5,p,16,2);p+=4; |
nyatla | 48:00d211aac2ec | 32 | *p='-';p++; |
nyatla | 48:00d211aac2ec | 33 | for(i=0;i<6;i++){ |
nyatla | 48:00d211aac2ec | 34 | NyLPC_uitoa2(i_inst->f6[i],p,16,2);p+=2; |
nyatla | 48:00d211aac2ec | 35 | } |
nyatla | 48:00d211aac2ec | 36 | *p='\0'; |
nyatla | 48:00d211aac2ec | 37 | } |