ForestHub SDK
0.1.0
C++14 LLM SDK for PC and embedded platforms
Loading...
Searching...
No Matches
network.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: AGPL-3.0-only
2
// Copyright (c) 2026 ForestHub. All rights reserved.
3
// For commercial licensing, visit https://github.com/ForestHubAI/fh-sdk
4
5
#ifndef FORESTHUB_PLATFORM_NETWORK_HPP
6
#define FORESTHUB_PLATFORM_NETWORK_HPP
7
10
11
#include <cstdint>
12
#include <string>
13
14
namespace
foresthub
{
15
namespace
platform
{
16
18
enum class
NetworkStatus
: uint8_t {
19
kDisconnected
,
20
kConnecting
,
21
kConnected
,
22
kFailed
23
};
24
30
struct
NetworkConfig
{
31
const
char
*
ssid
=
nullptr
;
32
const
char
*
password
=
nullptr
;
33
};
34
40
class
NetworkInterface
{
41
public
:
42
virtual
~NetworkInterface
() =
default
;
43
48
virtual
std::string
Connect
(
unsigned
long
timeout_ms = 30000) = 0;
49
51
virtual
void
Disconnect
() = 0;
52
54
virtual
NetworkStatus
GetStatus
()
const
= 0;
55
58
virtual
std::string
GetLocalIp
()
const
= 0;
59
62
virtual
int
GetSignalStrength
()
const
= 0;
63
};
64
65
}
// namespace platform
66
}
// namespace foresthub
67
68
#endif
// FORESTHUB_PLATFORM_NETWORK_HPP
foresthub::platform::NetworkInterface
Abstract interface for network connectivity.
Definition
network.hpp:40
foresthub::platform::NetworkInterface::Connect
virtual std::string Connect(unsigned long timeout_ms=30000)=0
Activate the network connection.
foresthub::platform::NetworkInterface::GetStatus
virtual NetworkStatus GetStatus() const =0
Get the current connection status.
foresthub::platform::NetworkInterface::GetSignalStrength
virtual int GetSignalStrength() const =0
Get signal strength in dBm.
foresthub::platform::NetworkInterface::GetLocalIp
virtual std::string GetLocalIp() const =0
Get the local IP address as string.
foresthub::platform::NetworkInterface::Disconnect
virtual void Disconnect()=0
Disconnect from the network.
foresthub::platform
Hardware abstraction layer: network, console, time, crypto, and GPIO interfaces.
foresthub::platform::NetworkStatus
NetworkStatus
Connection state of the network subsystem.
Definition
network.hpp:18
foresthub::platform::NetworkStatus::kConnected
@ kConnected
Successfully connected and ready.
Definition
network.hpp:21
foresthub::platform::NetworkStatus::kFailed
@ kFailed
Connection attempt failed.
Definition
network.hpp:22
foresthub::platform::NetworkStatus::kConnecting
@ kConnecting
Connection attempt in progress.
Definition
network.hpp:20
foresthub::platform::NetworkStatus::kDisconnected
@ kDisconnected
Not connected (clean state or after Disconnect()).
Definition
network.hpp:19
foresthub
Top-level namespace for the ForestHub SDK.
foresthub::platform::NetworkConfig
Construction-time configuration for the network subsystem.
Definition
network.hpp:30
foresthub::platform::NetworkConfig::password
const char * password
Network password (nullptr for open networks).
Definition
network.hpp:32
foresthub::platform::NetworkConfig::ssid
const char * ssid
Network identifier (nullptr to skip setup).
Definition
network.hpp:31
include
foresthub
platform
network.hpp
Generated by
1.14.0