Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4712a8ef authored by Henri Chataing's avatar Henri Chataing
Browse files

bluetooth_packetgen: Move checksum_type_checker.h and

custom_type_checker.h

These files used to be located inside system/gd/packet/parser but
are actually only referenced from the generated packet files.
It is more appropriate to place them within the packet runtime
implementation.

Test: m root-canal
Change-Id: Ie4d85de947e594ca9a14db749c599dc01fbe054c
parent 501e52fe
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -39,7 +39,9 @@ class ChecksumTypeChecker {

  // If all the methods are defined, this one matches
  template <class C, typename CRET>
  static int Test(InitializeChecker<C, &C::Initialize>*, AddByteChecker<C, &C::AddByte>*,
  static int Test(
      InitializeChecker<C, &C::Initialize>*,
      AddByteChecker<C, &C::AddByte>*,
      GetChecksumChecker<C, CRET, &C::GetChecksum>*);

  // This one matches everything else
+5 −2
Original line number Diff line number Diff line
@@ -41,8 +41,11 @@ class CustomTypeChecker {
  struct ToStringChecker {};

  template <class C, bool little_endian>
  static int Test(SerializeChecker<C, &C::Serialize>*, SizeChecker<C, &C::size>*,
                  ParseChecker<C, little_endian, &C::Parse>*, ToStringChecker<C, &C::ToString>*);
  static int Test(
      SerializeChecker<C, &C::Serialize>*,
      SizeChecker<C, &C::size>*,
      ParseChecker<C, little_endian, &C::Parse>*,
      ToStringChecker<C, &C::ToString>*);

  template <class C, bool little_endian>
  static char Test(...);
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
 */

#include "checksum_def.h"
#include "checksum_type_checker.h"

#include "fields/checksum_field.h"
#include "util.h"

+2 −2
Original line number Diff line number Diff line
@@ -96,8 +96,8 @@ bool generate_cpp_headers_one_file(
#if defined(PACKET_FUZZ_TESTING) || defined(PACKET_TESTING) || defined(FUZZ_TARGET)
#include "packet/raw_builder.h"
#endif
#include "packet/parser/checksum_type_checker.h"
#include "packet/parser/custom_type_checker.h"
#include "packet/checksum_type_checker.h"
#include "packet/custom_type_checker.h"

)";

+5 −5
Original line number Diff line number Diff line
@@ -13,22 +13,22 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <cstring>
#include <memory>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <cstring>
#include <memory>

#include "hci/address.h"
#include "hci/class_of_device.h"
#include "packet/base_packet_builder.h"
#include "packet/bit_inserter.h"
#include "packet/checksum_type_checker.h"
#include "packet/custom_type_checker.h"
#include "packet/iterator.h"
#include "packet/packet_builder.h"
#include "packet/packet_struct.h"
#include "packet/packet_view.h"
#include "packet/parser/checksum_type_checker.h"
#include "packet/parser/custom_type_checker.h"
#include "packet/raw_builder.h"

namespace py = pybind11;