@@ -172,24 +172,50 @@ namespace osc {
172172 msg.init (addr);
173173 send (ip, port, msg, std::forward<Rest>(rest)...);
174174 }
175- template <typename ... Rest>
176- void send (const String& ip, const uint16_t port, const TimeTag& tt, const String& addr, Rest&&... rest) {
177- msg.init (addr, tt);
178- send (ip, port, msg, std::forward<Rest>(rest)...);
179- }
180175 template <typename First, typename ... Rest>
181176 void send (const String& ip, const uint16_t port, Message& m, First&& first, Rest&&... rest) {
182177 m.push (first);
183178 send (ip, port, m, std::forward<Rest>(rest)...);
184179 }
185180 void send (const String& ip, const uint16_t port, Message& m) {
186- auto stream = UdpMapManager<S>::getInstance ().getUdp (local_port);
187181 this ->writer .init ().encode (m);
182+ this ->send (ip, port);
183+ }
184+ void send (const String &ip, const uint16_t port)
185+ {
186+ auto stream = UdpMapManager<S>::getInstance ().getUdp (local_port);
188187 stream->beginPacket (ip.c_str (), port);
189188 stream->write (this ->writer .data (), this ->writer .size ());
190189 stream->endPacket ();
191190 }
192191
192+ #ifndef ARDUINOOSC_DISABLE_BUNDLE
193+
194+ void begin_bundle (const TimeTag &tt) {
195+ this ->writer .init ().begin_bundle (tt);
196+ }
197+ template <typename ... Rest>
198+ void add_bundle (const String& addr, Rest&&... rest) {
199+ this ->msg .init (addr);
200+ this ->add_bundle (this ->msg , std::forward<Rest>(rest)...);
201+ }
202+ template <typename First, typename ... Rest>
203+ void add_bundle (Message& m, First&& first, Rest&&... rest)
204+ {
205+ m.push (first);
206+ add_bundle (m, std::forward<Rest>(rest)...);
207+ }
208+ void add_bundle (Message& m)
209+ {
210+ this ->writer .encode (m);
211+ }
212+ void end_bundle ()
213+ {
214+ this ->writer .end_bundle ();
215+ }
216+
217+ #endif // ARDUINOOSC_DISABLE_BUNDLE
218+
193219 void send (const Destination& dest, ElementRef elem) {
194220 elem->init (msg, dest.addr );
195221 elem->encodeTo (msg);
@@ -227,9 +253,19 @@ namespace osc {
227253 void send (const String& ip, const uint16_t port, const String& addr, Ts&&... ts) {
228254 client.send (ip, port, addr, std::forward<Ts>(ts)...);
229255 }
256+
257+ void begin_bundle (const TimeTag &tt) {
258+ client.begin_bundle (tt);
259+ }
230260 template <typename ... Ts>
231- void send (const String& ip, const uint16_t port, const TimeTag& tt, const String& addr, Ts&&... ts) {
232- client.send (ip, port, tt, addr, std::forward<Ts>(ts)...);
261+ void add_bundle (const String& addr, Ts&&... ts) {
262+ client.add_bundle (addr, std::forward<Ts>(ts)...);
263+ }
264+ void end_bundle () {
265+ client.end_bundle ();
266+ }
267+ void send_bundle (const String& ip, const uint16_t port) {
268+ client.send (ip, port);
233269 }
234270
235271 void post () {
0 commit comments