Coverage Report

Created: 2021-08-28 18:14

D:\git\skunkworks\herald-for-cpp\herald\src\payload\beacon\beacon_payload_data_supplier.cpp
Line
Count
Source (jump to first uncovered line)
1
//  Copyright 2020-2021 Herald Project Contributors
2
//  SPDX-License-Identifier: Apache-2.0
3
//
4
5
#include "herald/payload/beacon/beacon_payload_data_supplier.h"
6
#include "herald/datatype/data.h"
7
8
#include <optional>
9
10
namespace herald {
11
namespace payload {
12
namespace beacon {
13
14
ConcreteBeaconPayloadDataSupplierV1::ConcreteBeaconPayloadDataSupplierV1(uint16_t countryCode, uint16_t stateCode, 
15
    MYUINT32 code, ConcreteExtendedDataV1 extendedData)
16
  : BeaconPayloadDataSupplier(),
17
    country(countryCode), state(stateCode), code(code), extendedData(extendedData), mPayload()
18
2
{
19
2
  mPayload.append(uint8_t(0x30)); // Venue Beacon payload V1
20
2
  mPayload.append(countryCode);
21
2
  mPayload.append(stateCode);
22
2
  mPayload.append(std::uint32_t(code));
23
2
  auto edpl = extendedData.payload();
24
2
  // if (edpl.size() > 0) {
25
2
    mPayload.append(edpl);
26
2
  // }
27
2
}
28
// ConcreteBeaconPayloadDataSupplierV1::ConcreteBeaconPayloadDataSupplierV1(uint16_t countryCode, uint16_t stateCode, 
29
//     unsigned int code, ConcreteExtendedDataV1 extendedData)
30
//   : BeaconPayloadDataSupplier(),
31
//     mImpl(std::make_unique<Impl>(countryCode,stateCode,(uint32_t)code,extendedData))
32
// {
33
//   ;
34
// }
35
ConcreteBeaconPayloadDataSupplierV1::ConcreteBeaconPayloadDataSupplierV1(uint16_t countryCode, uint16_t stateCode, 
36
    MYUINT32 code)
37
  : BeaconPayloadDataSupplier(),
38
    country(countryCode), state(stateCode), code(code), extendedData(), mPayload()
39
0
{
40
0
  mPayload.append(uint8_t(0x30)); // Venue Beacon payload V1
41
0
  mPayload.append(countryCode);
42
0
  mPayload.append(stateCode);
43
0
  mPayload.append(std::uint32_t(code));
44
0
}
45
46
ConcreteBeaconPayloadDataSupplierV1::~ConcreteBeaconPayloadDataSupplierV1()
47
2
{
48
2
  ;
49
2
}
50
51
PayloadData
52
ConcreteBeaconPayloadDataSupplierV1::legacyPayload(const PayloadTimestamp timestamp, const Device& device)
53
0
{
54
0
  return PayloadData();
55
0
}
56
57
PayloadData
58
ConcreteBeaconPayloadDataSupplierV1::payload(const PayloadTimestamp timestamp, const Device& device)
59
2
{
60
2
  return mPayload;
61
2
}
62
63
PayloadData
64
ConcreteBeaconPayloadDataSupplierV1::payload(const PayloadTimestamp timestamp)
65
0
{
66
0
  return mPayload;
67
0
}
68
69
// std::vector<PayloadData>
70
// ConcreteBeaconPayloadDataSupplierV1::payload(const Data& data)
71
// {
72
//   return std::vector<PayloadData>();
73
// }
74
75
}
76
}
77
}