mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
chg: return values.
This commit is contained in:
parent
18d2c24e9e
commit
2fecbb6141
2 changed files with 5 additions and 4 deletions
|
@ -42,6 +42,7 @@
|
|||
#include <stdbool.h> // for bool
|
||||
#include "parity.h" // for parity test
|
||||
#include "commonutil.h" // colors
|
||||
#include "pm3_cmd.h" // error codes
|
||||
//**********************************************************************************************
|
||||
//---------------------------------Utilities Section--------------------------------------------
|
||||
//**********************************************************************************************
|
||||
|
@ -223,13 +224,13 @@ size_t addParity(uint8_t *src, uint8_t *dest, uint8_t sourceLen, uint8_t pLen, u
|
|||
}
|
||||
|
||||
// array must be size dividable with 8
|
||||
uint8_t bits_to_array(const uint8_t *bits, size_t size, uint8_t *dest) {
|
||||
if ((size == 0) || (size % 8) != 0) return 0;
|
||||
int bits_to_array(const uint8_t *bits, size_t size, uint8_t *dest) {
|
||||
if ((size == 0) || (size % 8) != 0) return PM3_EINVARG;
|
||||
|
||||
for (uint32_t i = 0; i < (size / 8); i++)
|
||||
dest[i] = bytebits_to_byte((uint8_t *) bits + (i * 8), 8);
|
||||
|
||||
return 0;
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t bytebits_to_byte(uint8_t *src, size_t numbits) {
|
||||
|
|
|
@ -49,7 +49,7 @@ int askdemod(uint8_t *bits, size_t *size, int *clk, int *invert, int maxErr
|
|||
int askdemod_ext(uint8_t *bits, size_t *size, int *clk, int *invert, int maxErr, uint8_t amp, uint8_t askType, int *startIdx);
|
||||
void askAmp(uint8_t *bits, size_t size);
|
||||
int BiphaseRawDecode(uint8_t *bits, size_t *size, int *offset, int invert);
|
||||
uint8_t bits_to_array(const uint8_t *bits, size_t size, uint8_t *dest);
|
||||
int bits_to_array(const uint8_t *bits, size_t size, uint8_t *dest);
|
||||
uint32_t bytebits_to_byte(uint8_t *src, size_t numbits);
|
||||
uint32_t bytebits_to_byteLSBF(uint8_t *src, size_t numbits);
|
||||
uint16_t countFC(uint8_t *bits, size_t size, bool fskAdj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue