SPSP
Simple publish-subscribe protocol. Connects low power IoT clients to MQTT.
Main Page
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
z
~
Variables
_
a
b
c
e
h
i
k
l
m
n
p
q
r
s
t
u
v
Files
File List
•
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
include
linux
spsp
linux/spsp/random.hpp
Go to the documentation of this file.
1
10
#pragma once
11
12
#include <cstdlib>
13
#include <sys/random.h>
14
15
#include "
spsp/random_if.hpp
"
16
17
namespace
SPSP
18
{
24
class
Random :
public
IRandom
25
{
26
public
:
34
inline
void
bytes
(
void
* buf,
size_t
len)
const
35
{
36
if
(getrandom(buf, len, 0) != len) {
37
throw
RandomGeneratorError
(
"Generation failed"
);
38
}
39
}
40
};
41
}
// namespace SPSP
random_if.hpp
Platform-dependent random generator interface.
SPSP::Random::bytes
void bytes(void *buf, size_t len) const
Generates len truly random bytes in buf
Definition:
linux/spsp/random.hpp:34
SPSP::RandomGeneratorError
Random generator error.
Definition:
random_if.hpp:22
Generated by
1.8.17