Skip to content

Commit

Permalink
feat: bump arxcontainer to v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hideakitai committed Feb 5, 2024
1 parent fd80df8 commit dcba74c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion ArduinoOSC/OSCClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ namespace osc {
private:
ElementRef publish_impl(const String& ip, const uint16_t port, const String& addr, ElementRef ref) {
Destination dest {ip, port, addr};
dest_map.insert(make_pair(dest, ref));
dest_map.insert(std::make_pair(dest, ref));
return ref;
}
};
Expand Down
2 changes: 1 addition & 1 deletion ArduinoOSC/OSCServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ namespace osc {

Server<S>& getServer(const uint16_t port) {
if (server_map.find(port) == server_map.end())
server_map.insert(make_pair(port, ServerRef<S>(new Server<S>(port))));
server_map.insert(std::make_pair(port, ServerRef<S>(new Server<S>(port))));
return *(server_map[port].get());
}

Expand Down
10 changes: 5 additions & 5 deletions ArduinoOSC/OscMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace osc {

Message& pushBool(const bool b) {
type_tags += (char)(b ? TYPE_TAG_TRUE : TYPE_TAG_FALSE);
arguments.push_back(make_pair(storage.size(), storage.size()));
arguments.push_back(std::make_pair(storage.size(), storage.size()));
return *this;
}
Message& pushInt32(const int32_t i) { return pushPod(TYPE_TAG_INT32, i); }
Expand All @@ -107,14 +107,14 @@ namespace osc {
Message& pushDouble(const double d) { return pushPod(TYPE_TAG_DOUBLE, d); }
Message& pushString(const String& s) {
type_tags += (char)TYPE_TAG_STRING;
arguments.push_back(make_pair(storage.size(), s.length() + 1));
arguments.push_back(std::make_pair(storage.size(), s.length() + 1));
strcpy(storage.getBytes(s.length() + 1), s.c_str());
return *this;
}
Message& pushBlob(const Blob& b) { return pushBlob(b.data(), b.size()); }
Message& pushBlob(const void* ptr, const size_t num_bytes) {
type_tags += (char)TYPE_TAG_BLOB;
arguments.push_back(make_pair(storage.size(), num_bytes + 4));
arguments.push_back(std::make_pair(storage.size(), num_bytes + 4));
pod2bytes<int32_t>((int32_t)num_bytes, storage.getBytes(4));
if (num_bytes) memcpy(storage.getBytes(num_bytes), ptr, num_bytes);
return *this;
Expand Down Expand Up @@ -222,7 +222,7 @@ namespace osc {
size_t iarg = 0;
while (iarg < type_tags.length()) {
size_t len = getArgSize(type_tags[iarg], arg);
arguments.push_back(make_pair((size_t)(arg - storage.begin()), len));
arguments.push_back(std::make_pair((size_t)(arg - storage.begin()), len));
arg += ceil4(len);
++iarg;
}
Expand Down Expand Up @@ -308,7 +308,7 @@ namespace osc {
template <typename POD>
Message& pushPod(const int tag, const POD& v) {
type_tags += (char)tag;
arguments.push_back(make_pair(storage.size(), sizeof(POD)));
arguments.push_back(std::make_pair(storage.size(), sizeof(POD)));
pod2bytes(v, storage.getBytes(sizeof(POD)));
return *this;
}
Expand Down
26 changes: 13 additions & 13 deletions ArduinoOSC/OscTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,47 +92,47 @@ namespace osc {
template <typename S>
using UdpRef = std::shared_ptr<S>;
template <typename S>
using UdpMap = arx::map<uint16_t, UdpRef<S>, ARDUINOOSC_MAX_SUBSCRIBE_PORTS>;
using UdpMap = arx::stdx::map<uint16_t, UdpRef<S>, ARDUINOOSC_MAX_SUBSCRIBE_PORTS>;

namespace message {
using ArgumentType = arx::pair<size_t, size_t>;
using ArgumentQueue = arx::vector<ArgumentType, ARDUINOOSC_MAX_MSG_ARGUMENT_SIZE>;
using ArgumentType = arx::stdx::pair<size_t, size_t>;
using ArgumentQueue = arx::stdx::vector<ArgumentType, ARDUINOOSC_MAX_MSG_ARGUMENT_SIZE>;
class Message;
using MessageQueue = arx::vector<Message, ARDUINOOSC_MAX_MSG_QUEUE_SIZE>;
using MessageQueue = arx::stdx::vector<Message, ARDUINOOSC_MAX_MSG_QUEUE_SIZE>;
} // namespace message
#ifndef ARDUINOOSC_DISABLE_BUNDLE
using BundleData = arx::vector<uint32_t, ARDUINOOSC_MAX_MSG_BUNDLE_SIZE>;
using BundleData = arx::stdx::vector<uint32_t, ARDUINOOSC_MAX_MSG_BUNDLE_SIZE>;
#endif
using Blob = arx::vector<char, ARDUINOOSC_MAX_MSG_BYTE_SIZE>;
using Blob = arx::stdx::vector<char, ARDUINOOSC_MAX_MSG_BYTE_SIZE>;

namespace client {
namespace element {
class Base;
using Ref = std::shared_ptr<Base>;
using TupleRef = arx::vector<Ref, ARDUINOOSC_MAX_MSG_ARGUMENT_SIZE>;
using TupleRef = arx::stdx::vector<Ref, ARDUINOOSC_MAX_MSG_ARGUMENT_SIZE>;
} // namespace element
class Destination;
using ElementRef = element::Ref;
using ElementTupleRef = element::TupleRef;
using DestinationMap = arx::map<Destination, ElementRef, ARDUINOOSC_MAX_PUBLISH_DESTINATION>;
using DestinationMap = arx::stdx::map<Destination, ElementRef, ARDUINOOSC_MAX_PUBLISH_DESTINATION>;
} // namespace client

namespace server {
namespace element {
class Base;
using Ref = std::shared_ptr<Base>;
using TupleRef = arx::vector<Ref, ARDUINOOSC_MAX_MSG_ARGUMENT_SIZE>;
using dummy_vector_t = arx::vector<size_t, ARDUINOOSC_MAX_MSG_ARGUMENT_SIZE>;
using TupleRef = arx::stdx::vector<Ref, ARDUINOOSC_MAX_MSG_ARGUMENT_SIZE>;
using dummy_vector_t = arx::stdx::vector<size_t, ARDUINOOSC_MAX_MSG_ARGUMENT_SIZE>;
} // namespace element
using ElementRef = element::Ref;
using ElementTupleRef = element::TupleRef;
using CallbackMap = arx::map<String, ElementRef, ARDUINOOSC_MAX_SUBSCRIBE_ADDRESS_PER_PORT>;
using CallbackMap = arx::stdx::map<String, ElementRef, ARDUINOOSC_MAX_SUBSCRIBE_ADDRESS_PER_PORT>;
template <typename S>
class Server;
template <typename S>
using ServerRef = std::shared_ptr<Server<S>>;
template <typename S>
using ServerMap = arx::map<uint16_t, ServerRef<S>, ARDUINOOSC_MAX_SUBSCRIBE_PORTS>;
using ServerMap = arx::stdx::map<uint16_t, ServerRef<S>, ARDUINOOSC_MAX_SUBSCRIBE_PORTS>;
} // namespace server

} // namespace osc
Expand Down Expand Up @@ -171,7 +171,7 @@ namespace osc {
struct Storage {
Blob data;

// reserve() makes no sense on arx::vector because capacity is fixed
// reserve() makes no sense on arx::stdx::vector because capacity is fixed
Storage() { data.reserve(200); }

char* getBytes(const size_t sz) {
Expand Down
4 changes: 2 additions & 2 deletions ArduinoOSC/OscUdpMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace osc {
// use first port for PORT_DISCARD if some udp instances exist
if (port == PORT_DISCARD) {
if (udp_map.empty()) {
udp_map.insert(make_pair(port, UdpRef<S>(new S())));
udp_map.insert(std::make_pair(port, UdpRef<S>(new S())));
udp_map[port]->begin(port);
}
return udp_map.begin()->second;
Expand All @@ -53,7 +53,7 @@ namespace osc {
udp_discard_ref->second->stop();
udp_map.erase(udp_discard_ref);
}
udp_map.insert(make_pair(port, UdpRef<S>(new S())));
udp_map.insert(std::make_pair(port, UdpRef<S>(new S())));
udp_map[port]->begin(port);
}
return udp_map[port];
Expand Down
4 changes: 2 additions & 2 deletions examples/arduino/OscEther/OscEther.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

// Ethernet stuff
uint8_t mac[] = {0xAB, 0xCD, 0xEF, 0x01, 0x23, 0x45};
const IPAddress ip(192, 168, 1, 201);
const IPAddress ip(192, 168, 0, 201);
// Ethernet with useful options
// const IPAddress dns (192, 168, 1, 1);
// const IPAddress gateway (192, 168, 1, 1);
// const IPAddress subnet (255, 255, 255, 0);

// for ArduinoOSC
const char* host = "192.168.1.200";
const char* host = "192.168.0.200";
const int recv_port = 54321;
const int bind_port = 54345;
const int send_port = 55555;
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"url": "https://github.com/hideakitai",
"maintainer": true
},
"version": "0.4.0",
"version": "0.4.1",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",
"dependencies":
{
"hideakitai/ArxContainer": "*",
"hideakitai/ArxContainer": ">=0.6.0",
"hideakitai/ArxSmartPtr": "*",
"hideakitai/ArxTypeTraits": "*",
"hideakitai/DebugLog": "*"
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=ArduinoOSC
version=0.4.0
version=0.4.1
author=hideakitai
maintainer=hideakitai
sentence=OSC subscriber / publisher for Arduino
paragraph=OSC subscriber / publisher for Arduino
category=Communication
url=https://github.com/hideakitai/ArduinoOSC
architectures=*
depends=ArxContainer,ArxSmartPtr,ArxTypeTraits,DebugLog
depends=ArxContainer(>=0.6.0),ArxSmartPtr,ArxTypeTraits,DebugLog

0 comments on commit dcba74c

Please sign in to comment.