You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include "bstr.h"
|
|
|
|
|
|
|
|
bstr16_t bstr16_create(const uint8_t *data, uint16_t len)
|
|
|
|
{
|
|
|
|
uint8_t * str = malloc(2+len*sizeof(uint8_t));
|
|
|
|
if (!str)
|
|
|
|
return 0;
|
|
|
|
*((uint16_t*)str)=len;
|
|
|
|
memcpy(str+2,data,len);
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|