-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
164 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#pragma once | ||
|
||
#include "../field.hpp" | ||
|
||
namespace ArduinoNDEF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma once | ||
|
||
#include "payload.hpp" | ||
|
||
namespace ArduinoNDEF | ||
{ | ||
namespace Field | ||
{ | ||
|
||
class UriPayload : public Payload | ||
{ | ||
public: | ||
/** | ||
* @brief Create a NDEF URI payload from an URI C-string | ||
* @param uri The URI C-string | ||
* @return A pointer to a new NDEF URI payload object | ||
*/ | ||
static UriPayload *from_uri(const char *uri); | ||
|
||
/** | ||
* @brief Get the URI | ||
* @return The URI C-string | ||
* @note Memory is allocated for the URI string and it is the responsibility of the | ||
* caller to free it | ||
*/ | ||
const char *to_uri() const; | ||
|
||
private: | ||
UriPayload(const uint8_t *data, uint8_t length) : | ||
Payload(data, length, OwnershipUnique) | ||
{ | ||
} | ||
}; | ||
|
||
} // namespace Field | ||
} // namespace ArduinoNDEF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.