Questions tagged [uint8t]

uint8_t (C language - Type). uint8_t stores an 8-bit unsigned number, from 0 to 255. It is equal to unsigned char.

272 questions
3
votes
1 answer

Neon casting issue

I am new to the NEON intrinsics (A9 processor). I want to convert uint8x16_t to int32x4_t value . I tried to use the vreinterpret_s32_u8 to do so which did not work . Can anyone please guide me? Really appreciate your help .
user3476225
  • 240
  • 5
  • 14
3
votes
1 answer

How to read specific bits of an unsigned int

I have an uint8_t and I need to read/write to specific bits. How would I go about doing this. Specifically what I mean is that I need to write and then later read the first 7 bits for one value and the last bit for another value. edit: forgot to…
mavius
  • 31
  • 1
  • 4
2
votes
1 answer

Copy const char* to uint8_t array

My C-API takes an array of uint8_t's as config parameter. I'm arriving at its doorsteps with a const char*. How do I now copy the chars over to the uint8_t array in the most unproblematic way? Here's what I've got (contrived ofc): Demo #include…
glades
  • 3,778
  • 1
  • 12
  • 34
2
votes
1 answer

Overloading function with char and uint8_t types

To implement a basic interface for an LCD I need to write the function print for all basic types. I need to write void print(char c); and also void print(uint8_t c); The first function tells: "I want to write the character c", and the second tells…
Antonio
  • 579
  • 1
  • 3
  • 12
2
votes
1 answer

Dart : Index out of range: index should be less than N: N (where N is the size of file in bytes). How to fix this runtime error?

I am trying to decode some animated webp files in dart but getting the runtime error of 'index out of range and it should be less than N. and N is the size of file in bytes. But images other than this folder works fine. Link of animated webp files I…
CrackerKSR
  • 1,380
  • 1
  • 11
  • 29
2
votes
3 answers

Unable to create 2D vector in CPP std::vector> by just giving the size

I was creating empty 2D vector in a header file by just providing size but unable to create it. class Grid { public: int rows = 5/0.05; int cols = 6/0.05; std::vector>…
2
votes
1 answer

VP8 C/C++ source, how to encode frames in ARGB format to frame instead of from file

I'm trying to get started with the VP8 library, I'm not building it in the standard way they tell you to, I just loaded all of the main files and the "encoder" folder into a new Visual Studio C++ DLL project, and just included the C files in an…
2
votes
0 answers

Loop over uint8_t array using pointer and array length gives weird result

I am trying to loop over an uint8_t array inside a function. I am passing the pointer to the array and the number of elements in the array. If I now try to print the number, this gives me some weird result, if I compare it to looping over an int…
rinkert
  • 6,593
  • 2
  • 12
  • 31
2
votes
2 answers

C int memory storage. Least signinficant vs most significant bits?

I'd expect the following combination of two uint8_t (0x00 and 0x01) into one uint16_t to give me a value of 0x0001, when I combine them consecutively in memory. Instead I obtain 0x0100 = 256, which I'm surprised of. #include #include…
L. Arnaud
  • 55
  • 6
2
votes
1 answer

post training quantization for mobilenet V1 not working

I am trying to convert mobilenet V1 .pb file to quantized tflite file. I used the below command to do the quantization: tflite_convert \ --output_file=/home/wc/users/Mostafiz/TPU/models/mobilnet/test2_4thSep/mobilenetv1_test5.tflite \ …
MMH
  • 1,676
  • 5
  • 26
  • 43
2
votes
1 answer

Value of type 'UnsafeMutableRawPointer' has no subscripts Swift 5

I'm trying to convert objective c code into swift. UInt8* data = calloc(bytesPerRow, height); when I convert it in swift, It returning "UnsafeMutableRawPointer". I need of UInt8. let data = calloc(bytesPerRow, height)! //…
ZAFAR007
  • 3,049
  • 1
  • 34
  • 45
2
votes
1 answer

How to create a boost::asio::buffer with uint8_t* [Is it possible?]

This question is about boost::asio::buffer I have a call to send data over a TCP socket. Following is the call: std::vector data = GetDataToSend(); boost::asio::async_write(tcp_socket, boost::asio::buffer(data), [this](const…
AdeleGoldberg
  • 1,289
  • 3
  • 12
  • 28
2
votes
2 answers

How to compare uint8_t array to a string in C?

I have an input which comes over UART. uint8_t uartRX_data[UART_RX_BUF_SIZE]=""; I need to pass this data to a function. And, in this function I want to compare it with predefined strings like: char RESP_OK[] = "OK"; char…
Caglayan DOKME
  • 948
  • 8
  • 21
2
votes
2 answers

Hex_string to uint8_t msg[]

I want convert the characters in hex string "0b7c28c9b7290c98d7438e70b3d3f7c848fbd7d1dc194ff83f4f7cc9b1378e98" to uint8_t msg[] and do not understand how to do it. It seems simple, but have been unable to figure it out. I want to convert each…
vbujym
  • 109
  • 2
  • 11
2
votes
2 answers

convert uint8_t array to string

I the project I have a struct that has one member of type unsigned int array(uint8_t) like below typedef uint8_t U8; typedef struct { /* other members */ U8 Data[8]; } Frame; a pointer to a variable of type Frame is received that…
Amir-Mousavi
  • 4,273
  • 12
  • 70
  • 123