Skip to content

Commit

Permalink
Add some more new simple E1.33 inflators
Browse files Browse the repository at this point in the history
Tests still required for these!
  • Loading branch information
peternewman committed Jul 3, 2023
1 parent 5c56490 commit 9fab749
Show file tree
Hide file tree
Showing 6 changed files with 280 additions and 0 deletions.
55 changes: 55 additions & 0 deletions libs/acn/BrokerClientAddInflator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* BrokerClientAddInflator.h
* Interface for the BrokerClientAddInflator class.
* Copyright (C) 2023 Peter Newman
*/

#ifndef LIBS_ACN_BROKERCLIENTADDINFLATOR_H_
#define LIBS_ACN_BROKERCLIENTADDINFLATOR_H_

#include "ola/acn/ACNVectors.h"
#include "libs/acn/BaseInflator.h"

namespace ola {
namespace acn {

class BrokerClientAddInflator: public BaseInflator {
friend class BrokerClientAddInflatorTest;

public:
BrokerClientAddInflator()
: BaseInflator() {
}
~BrokerClientAddInflator() {}

uint32_t Id() const { return ola::acn::VECTOR_BROKER_CLIENT_ADD; }

protected:
// The 'header' is 0 bytes in length.
bool DecodeHeader(HeaderSet*,
const uint8_t*,
unsigned int,
unsigned int *bytes_used) {
*bytes_used = 0;
return true;
}

void ResetHeaderField() {} // namespace noop
};
} // namespace acn
} // namespace ola
#endif // LIBS_ACN_BROKERCLIENTADDINFLATOR_H_
55 changes: 55 additions & 0 deletions libs/acn/BrokerClientEntryChangeInflator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* BrokerClientEntryChangeInflator.h
* Interface for the BrokerClientEntryChangeInflator class.
* Copyright (C) 2023 Peter Newman
*/

#ifndef LIBS_ACN_BROKERCLIENTENTRYCHANGEINFLATOR_H_
#define LIBS_ACN_BROKERCLIENTENTRYCHANGEINFLATOR_H_

#include "ola/acn/ACNVectors.h"
#include "libs/acn/BaseInflator.h"

namespace ola {
namespace acn {

class BrokerClientEntryChangeInflator: public BaseInflator {
friend class BrokerClientEntryChangeInflatorTest;

public:
BrokerClientEntryChangeInflator()
: BaseInflator() {
}
~BrokerClientEntryChangeInflator() {}

uint32_t Id() const { return ola::acn::VECTOR_BROKER_CLIENT_ENTRY_CHANGE; }

protected:
// The 'header' is 0 bytes in length.
bool DecodeHeader(HeaderSet*,
const uint8_t*,
unsigned int,
unsigned int *bytes_used) {
*bytes_used = 0;
return true;
}

void ResetHeaderField() {} // namespace noop
};
} // namespace acn
} // namespace ola
#endif // LIBS_ACN_BROKERCLIENTENTRYCHANGEINFLATOR_H_
55 changes: 55 additions & 0 deletions libs/acn/BrokerClientRemoveInflator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* BrokerClientRemoveInflator.h
* Interface for the BrokerClientRemoveInflator class.
* Copyright (C) 2023 Peter Newman
*/

#ifndef LIBS_ACN_BROKERCLIENTREMOVEINFLATOR_H_
#define LIBS_ACN_BROKERCLIENTREMOVEINFLATOR_H_

#include "ola/acn/ACNVectors.h"
#include "libs/acn/BaseInflator.h"

namespace ola {
namespace acn {

class BrokerClientRemoveInflator: public BaseInflator {
friend class BrokerClientRemoveInflatorTest;

public:
BrokerClientRemoveInflator()
: BaseInflator() {
}
~BrokerClientRemoveInflator() {}

uint32_t Id() const { return ola::acn::VECTOR_BROKER_CLIENT_REMOVE; }

protected:
// The 'header' is 0 bytes in length.
bool DecodeHeader(HeaderSet*,
const uint8_t*,
unsigned int,
unsigned int *bytes_used) {
*bytes_used = 0;
return true;
}

void ResetHeaderField() {} // namespace noop
};
} // namespace acn
} // namespace ola
#endif // LIBS_ACN_BROKERCLIENTREMOVEINFLATOR_H_
55 changes: 55 additions & 0 deletions libs/acn/BrokerInflator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* BrokerInflator.h
* Interface for the BrokerInflator class.
* Copyright (C) 2023 Peter Newman
*/

#ifndef LIBS_ACN_BROKERINFLATOR_H_
#define LIBS_ACN_BROKERINFLATOR_H_

#include "ola/acn/ACNVectors.h"
#include "libs/acn/BaseInflator.h"

namespace ola {
namespace acn {

class BrokerInflator: public BaseInflator {
friend class BrokerInflatorTest;

public:
BrokerInflator()
: BaseInflator(PDU::TWO_BYTES) {
}
~BrokerInflator() {}

uint32_t Id() const { return ola::acn::VECTOR_ROOT_BROKER; }

protected:
// The 'header' is 0 bytes in length.
bool DecodeHeader(HeaderSet*,
const uint8_t*,
unsigned int,
unsigned int *bytes_used) {
*bytes_used = 0;
return true;
}

void ResetHeaderField() {} // namespace noop
};
} // namespace acn
} // namespace ola
#endif // LIBS_ACN_BROKERINFLATOR_H_
55 changes: 55 additions & 0 deletions libs/acn/BrokerNullInflator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* BrokerNullInflator.h
* Interface for the BrokerNullInflator class.
* Copyright (C) 2023 Peter Newman
*/

#ifndef LIBS_ACN_BROKERNULLINFLATOR_H_
#define LIBS_ACN_BROKERNULLINFLATOR_H_

#include "ola/acn/ACNVectors.h"
#include "libs/acn/BaseInflator.h"

namespace ola {
namespace acn {

class BrokerNullInflator: public BaseInflator {
friend class BrokerNullInflatorTest;

public:
BrokerNullInflator()
: BaseInflator() {
}
~BrokerNullInflator() {}

uint32_t Id() const { return ola::acn::VECTOR_BROKER_NULL; }

protected:
// The 'header' is 0 bytes in length.
bool DecodeHeader(HeaderSet*,
const uint8_t*,
unsigned int,
unsigned int *bytes_used) {
*bytes_used = 0;
return true;
}

void ResetHeaderField() {} // namespace noop
};
} // namespace acn
} // namespace ola
#endif // LIBS_ACN_BROKERNULLINFLATOR_H_
5 changes: 5 additions & 0 deletions libs/acn/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ noinst_LTLIBRARIES += libs/acn/libolae131core.la
libs_acn_libolae131core_la_SOURCES = \
libs/acn/BaseInflator.cpp \
libs/acn/BaseInflator.h \
libs/acn/BrokerClientAddInflator.h \
libs/acn/BrokerClientEntryChangeInflator.h \
libs/acn/BrokerClientEntryHeader.h \
libs/acn/BrokerClientEntryPDU.cpp \
libs/acn/BrokerClientEntryPDU.h \
libs/acn/BrokerClientRemoveInflator.h \
libs/acn/BrokerConnectPDU.cpp \
libs/acn/BrokerConnectPDU.h \
libs/acn/BrokerInflator.h \
libs/acn/BrokerNullInflator.h \
libs/acn/BrokerNullPDU.cpp \
libs/acn/BrokerNullPDU.h \
libs/acn/BrokerPDU.cpp \
Expand Down

0 comments on commit 9fab749

Please sign in to comment.