|
1 | 1 | /*
|
2 | 2 | *
|
3 |
| - * Copyright (c) 2021 Project CHIP Authors |
| 3 | + * Copyright (c) 2021-2025 Project CHIP Authors |
4 | 4 | *
|
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License");
|
6 | 6 | * you may not use this file except in compliance with the License.
|
|
17 | 17 |
|
18 | 18 | /**
|
19 | 19 | * @file
|
20 |
| - * Provides an implementation of the NFCOnboardingPayloadManager interface for nRF Connect |
21 |
| - * SDK platform, by including Zephyr platform implementation. |
| 20 | + * Platform-specific NFCOnboardingPayloadManager implementation for nrfconnect. |
22 | 21 | */
|
23 | 22 |
|
24 | 23 | #pragma once
|
25 | 24 |
|
26 |
| -#include <platform/Zephyr/NFCOnboardingPayloadManagerImpl.h> |
| 25 | +#include <cstddef> |
| 26 | +#include <cstdint> |
| 27 | + |
| 28 | +namespace chip { |
| 29 | +namespace DeviceLayer { |
| 30 | + |
| 31 | +class NFCOnboardingPayloadManagerImpl final : public NFCOnboardingPayloadManager |
| 32 | +{ |
| 33 | + friend class NFCOnboardingPayloadManager; |
| 34 | + |
| 35 | +private: |
| 36 | + // ===== Members that implement the NFCOnboardingPayloadManager internal interface. |
| 37 | + |
| 38 | + CHIP_ERROR _Init(); |
| 39 | + CHIP_ERROR _StartTagEmulation(const char * payload, size_t payloadLength); |
| 40 | + CHIP_ERROR _StopTagEmulation(); |
| 41 | + bool _IsTagEmulationStarted() const { return mIsStarted; }; |
| 42 | + |
| 43 | + // ===== Members for internal use by this class. |
| 44 | + |
| 45 | + constexpr static uint8_t kNdefBufferSize = 128; |
| 46 | + |
| 47 | + uint8_t mNdefBuffer[kNdefBufferSize]; |
| 48 | + bool mIsStarted; |
| 49 | + |
| 50 | + // ===== Members for internal use by the following friends. |
| 51 | + |
| 52 | + friend NFCOnboardingPayloadManager & NFCOnboardingPayloadMgr(); |
| 53 | + friend NFCOnboardingPayloadManagerImpl & NFCOnboardingPayloadMgrImpl(); |
| 54 | + |
| 55 | + static NFCOnboardingPayloadManagerImpl sInstance; |
| 56 | +}; |
| 57 | + |
| 58 | +inline NFCOnboardingPayloadManager & NFCOnboardingPayloadMgr() |
| 59 | +{ |
| 60 | + return NFCOnboardingPayloadManagerImpl::sInstance; |
| 61 | +} |
| 62 | + |
| 63 | +inline NFCOnboardingPayloadManagerImpl & NFCOnboardingPayloadMgrImpl() |
| 64 | +{ |
| 65 | + return NFCOnboardingPayloadManagerImpl::sInstance; |
| 66 | +} |
| 67 | + |
| 68 | +} // namespace DeviceLayer |
| 69 | +} // namespace chip |
0 commit comments