Coverage Report

Created: 2021-08-28 18:14

D:\git\skunkworks\herald-for-cpp\herald\include\herald\payload\beacon\beacon_payload_data_supplier.h
Line
Count
Source
1
//  Copyright 2020-2021 Herald Project Contributors
2
//  SPDX-License-Identifier: Apache-2.0
3
//
4
5
#ifndef HERALD_BEACON_PAYLOAD_DATA_SUPPLIER_H
6
#define HERALD_BEACON_PAYLOAD_DATA_SUPPLIER_H
7
8
#include "../extended/extended_data.h"
9
#include "../payload_data_supplier.h"
10
#include "../../datatype/payload_timestamp.h"
11
12
#include <optional>
13
#include <cstdint>
14
15
namespace herald {
16
namespace payload {
17
namespace beacon {
18
19
using namespace herald::payload::extended;
20
using namespace herald::datatype;
21
22
using MYUINT32 = unsigned long;
23
24
class BeaconPayloadDataSupplier {
25
public:
26
2
  BeaconPayloadDataSupplier() = default;
27
2
  virtual ~BeaconPayloadDataSupplier() = default;
28
};
29
30
class ConcreteBeaconPayloadDataSupplierV1 : public BeaconPayloadDataSupplier {
31
public:
32
  ConcreteBeaconPayloadDataSupplierV1(std::uint16_t countryCode, std::uint16_t stateCode, 
33
    MYUINT32 code, ConcreteExtendedDataV1 extendedData);
34
  // ConcreteBeaconPayloadDataSupplierV1(uint16_t countryCode, uint16_t stateCode, 
35
  //   unsigned int code, ConcreteExtendedDataV1 extendedData);
36
  ConcreteBeaconPayloadDataSupplierV1(std::uint16_t countryCode, std::uint16_t stateCode, 
37
    MYUINT32 code);
38
  ~ConcreteBeaconPayloadDataSupplierV1();
39
40
  PayloadData legacyPayload(const PayloadTimestamp timestamp, const Device& device);
41
  PayloadData payload(const PayloadTimestamp timestamp, const Device& device);
42
  PayloadData payload(const PayloadTimestamp timestamp);
43
  // std::vector<PayloadData> payload(const Data& data);
44
45
private:
46
  uint16_t country;
47
  uint16_t state;
48
  MYUINT32 code;
49
  ConcreteExtendedDataV1 extendedData;
50
51
  PayloadData mPayload;
52
};
53
54
}
55
}
56
}
57
58
#endif