From 90ec2790673fe740617a0a4b2013df24fd802ae3 Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Fri, 29 Sep 2023 07:40:25 -0700 Subject: [PATCH] tv-casting-app docs: Marked code with triple backticks (#29497) --- .github/.wordlist.txt | 91 ++------------------------------- examples/tv-casting-app/APIs.md | 44 ++++++++-------- 2 files changed, 25 insertions(+), 110 deletions(-) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 24cdeaa092f691..67a6d1d8fac3e4 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -74,10 +74,7 @@ ApplyUpdate applyUpdateAction ApplyUpdateRequest ApplyUpdateResponse -appParameters -AppParameters approver -AppServer appspot appwrite aps @@ -194,11 +191,6 @@ capacitive CarbonDioxideConcentrationMeasurement CarbonMonoxideConcentrationMeasurement CaseAdminNode -castingApp -CastingApp -castingAppDidReceiveRequestForDeviceAttestationCredentials -CastingClient -CastingPlayer CatalogVendorId CBB cbd @@ -212,7 +204,6 @@ CCXML CDEEDC CDVersionNumber ced -certificationDeclaration cfg CFLAGS cgit @@ -236,8 +227,6 @@ ChipEchoResponder ChipImInitiator ChipImResponder ChipLight -ChipLogError -ChipLogProgress ChipMessageLayer CHIPOBLE CHIPProjectAppConfig @@ -288,9 +277,7 @@ Commissionable CommissionableDataProvider commissionables commissionee -commissionersCount CommissioningFlow -CommonCaseDeviceServerInitParamsProvider commondatastorage CONF CONFIG @@ -334,7 +321,6 @@ crypto cryptographic CSA csg -csrData csrrequest csu csv @@ -347,7 +333,6 @@ CurrentSaturation customAcl customizations cvfJ -CXE cxx CY CYW @@ -359,7 +344,6 @@ DAPLINK DataFrame datamodel DataModelRevision -DataProvider dataset datasets DataVersion @@ -385,7 +369,6 @@ DefaultOTARequestor DefaultOTARequestorDriver DefaultOTARequestorStorage DefaultSuccess -defaultTestPasscode definedValue DehumidificationControl DelayedActionTime @@ -405,7 +388,6 @@ dev devcontainer devCtrl DevelopmentCerts -deviceAttestationCert DeviceAttestationCredentialsProvider DeviceAttestationCredsExample DeviceCaCerts @@ -436,7 +418,6 @@ DHCPv dhrishi DiagnosticLogs dialout -didReceiveRequestToSignCertificateRequest diffstat diffsyms dimmable @@ -445,8 +426,6 @@ dirs disableNotifyUpdateApplied disambiguated discoverable -DiscoveryDelegate -DiscoveryDelegateImpl DispatchEvent DispatchEventToApplication DissolvedOxygenConcentrationMeasurement @@ -572,7 +551,6 @@ fffff Fi filepath fini -firmwareInformation FixedLabel flashdebug FlowMeasurement @@ -588,12 +566,10 @@ fstab fsync ftd fullclean -func fuzzer FW gbl gcloud -gCommissionableDataProvider GDB gdbgui gdbserver @@ -607,20 +583,12 @@ GenericPlatformManagerImpl GenericThreadConfigurationManagerImpl GenericThreadStackManagerImpl GenericWiFiConfigurationManagerImpl -GetDefaultDACVerifier GetDeviceId GetDeviceInfo GetDns -GetExampleDACProvider -GetId -GetInstance GetIP -GetLongValue getManualTests -GetRandU -GetSetupPasscode getstarted -GetTestAttestationTrustStore getTests GH ghcr @@ -655,8 +623,6 @@ Gv gz gzbf HaloaceticAcidsConcentrationMeasurement -HandleOnAdded -HandleOnUpdated hardcoded hardknott hardwarever @@ -720,7 +686,6 @@ Infineon ini init InitArgs -InitCommissionableDataProvider inlined InputLoop installDebug @@ -768,14 +733,10 @@ kAdminister kbd kBusy kCase -kCertificationDeclaration Kconfig kDacPublicKey -kDevelopmentDAC KeypadInput keyset -KeyValueStoreMgr -KeyValueStoreMgrImpl kGroup kInvalidCommandId KitProg @@ -784,17 +745,8 @@ kNewButton kNodeIdNotSpecified knownissues kOperate -KPAI kPAKEParameterError kPase -kQ -kRotatingDeviceIDUniqueIDLength -kSecAttrKeyClass -kSecAttrKeyClassPrivate -kSecAttrKeySizeInBits -kSecAttrKeyType -kSecAttrKeyTypeECSECPrimeRandom -kSpake kView KVS kWindowNotOpen @@ -837,15 +789,12 @@ LightingApp LightingColor LightingState LinkSoftwareAndDocumentationPack -LinuxCommissionableDataProvider -LinuxDeviceOptions LocalConfigDisabled localedef localhost LocalizationConfiguration localstatedir LockingState -LogDetail loopback LowPower LPC @@ -918,8 +867,6 @@ microcontroller microcontrollers MicroSD middleware -MII -MIIB minApplicableSoftwareVersion Minicom MinInterval @@ -943,15 +890,12 @@ MoveWithOnOff MPSL MRP MTD -MTRDeviceAttestationCredentials MTU Multiband Multicast multilib Multiprotocol multithreaded -MutableByteSpan -MutableByteSpanDataProvider mutexes mv MX @@ -995,8 +939,6 @@ nrfconnect nrfdks nrfutil nrfxlib -NSData -NSDictionary NTAG nullable nullptr @@ -1007,7 +949,6 @@ nwdiag nwk NXP objcopy -objectivec OccupancySensing OctetString OECORE @@ -1080,7 +1021,6 @@ params PartNumber PASE Passcode -passRetained PBKDF pbuf pbufs @@ -1097,15 +1037,13 @@ pem percentageLiftValue perfetto periodicQueryTimeout -PersistedStorage pexpect pickString PID Pigweed PinCode pinrequest -pIterationCount -pIterations +PIXIT pkgconfig PKI plaintext @@ -1127,11 +1065,7 @@ pre preprocessor Presetup PressureMeasurement -privateKey -PrivateKey -privateKeyRef prj -productAttestationIntermediateCert ProductID ProductLabel ProductName @@ -1149,17 +1083,14 @@ ProxyValid ProxyView PRs PSA -pSalt PSCAN PSECT PSK PSoC PTR pts -PublicKey PulseWidthModulation PumpConfigurationAndControl -pVerifier pwd PWM PXXXF @@ -1180,7 +1111,6 @@ QPG QRCode qrcodetool QRCodeUrl -qrYA QSPI QueryImage QueryImageResponse @@ -1234,10 +1164,6 @@ rmw rodata Rollershade rootfs -rotatingDeviceIdUniqueId -RotatingDeviceIdUniqueId -RotatingDeviceIdUniqueIdProvider -rotatingDeviceIdUniqueIdSpan RPC RPCs RPi @@ -1258,6 +1184,7 @@ runArgs RUNAS RunMain runtime +RVC rw RXD sandboxed @@ -1280,8 +1207,6 @@ sdkconfig SDKs SDKTARGETSYSROOT sdl -SecKey -SecKeyCreateWithData SecureCertDACProvider SED SEGGER @@ -1292,7 +1217,6 @@ sendto seqdiag SERIALDEVICE SerialNumber -serverInitParamsProvider ServiceId SetDns SetImageProcessorDelegate @@ -1302,10 +1226,8 @@ setpin setpoint SetpointRaiseLower SetRequestorInstance -setupPasscode SetUpPINCode SetupQRCode -SetValue sexualized sfv SHA @@ -1322,7 +1244,6 @@ SimpleFileExFlags SimpleLink SiWx sizedb -sizeof sl SLAAC SLTB @@ -1419,7 +1340,6 @@ TestGenExample TestGroupDemoConfig TestMultiRead TestName -TestOnlyCommissionableDataProvider TESTPASSWD TestPICS TESTSSID @@ -1510,7 +1430,6 @@ unfocus Unicast UniFlash UnitLocalization -Unmanaged unpair unprovisioned Unsecure @@ -1549,8 +1468,6 @@ venv ver Verifier Verifiers -VerifyOrDie -VerifyOrReturnValue VID vids virtualenv @@ -1647,6 +1564,4 @@ zephyrproject zhengyaohan Zigbee zigbeealliance -zigbeethread -PIXIT -RVC \ No newline at end of file +zigbeethread \ No newline at end of file diff --git a/examples/tv-casting-app/APIs.md b/examples/tv-casting-app/APIs.md index 2e9ecc191eb0a8..8a6212540be2f2 100644 --- a/examples/tv-casting-app/APIs.md +++ b/examples/tv-casting-app/APIs.md @@ -51,11 +51,11 @@ The steps to start a casting session are: 1. [Discover](#discover-casting-players) `CastingPlayer` devices using Matter Commissioner discovery. 1. [Connect](#connect-to-a-casting-player) to the `CastingPlayer` to discover - available endpoints. By connecting, the 'CastingClient' will send a User - Directed Commissioning (UDC) request to the 'CastingPlayer' device in order - to make a Matter commissioning request. The 'CastingPlayer' will then obtain - the appropriate user consent to allow a connection from this 'CastingClient' - and obtain the setup code needed to commission the 'CastingClient'. The setup + available endpoints. By connecting, the `CastingClient` will send a User + Directed Commissioning (UDC) request to the `CastingPlayer` device in order + to make a Matter commissioning request. The `CastingPlayer` will then obtain + the appropriate user consent to allow a connection from this `CastingClient` + and obtain the setup code needed to commission the `CastingClient`. The setup code will typically come from a corresponding TV content app or be input by the user. 1. [Select](#select-an-endpoint-on-the-casting-player) an available `Endpoint` @@ -82,7 +82,7 @@ _{Complete Initialization examples: [Linux](linux/simple-app.cpp) | | [iOS](darwin/TvCasting/TvCasting/MTRInitializationExample.swift)}_ A Casting Client must first initialize the Matter SDK and define the following -"DataProvider" objects for the the Matter Casting library to use throughout the +`DataProvider` objects for the the Matter Casting library to use throughout the client's lifecycle: 1. **Rotating Device Identifier** - Refer to the Matter specification for @@ -91,10 +91,10 @@ client's lifecycle: Then, instantiate a `DataProvider` object as described below. On Linux, define a `RotatingDeviceIdUniqueIdProvider` to provide the Casting - Client's RotatingDeviceIdUniqueId, by implementing a + Client's `RotatingDeviceIdUniqueId`, by implementing a `matter:casting::support::MutableByteSpanDataProvider`: - ```c++ + ```c class RotatingDeviceIdUniqueIdProvider : public MutableByteSpanDataProvider { private: chip::MutableByteSpan rotatingDeviceIdUniqueIdSpan; @@ -114,7 +114,7 @@ client's lifecycle: ``` On Android, define a `rotatingDeviceIdUniqueIdProvider` to provide the - Casting Client's RotatingDeviceIdUniqueId, by implementing a + Casting Client's `RotatingDeviceIdUniqueId`, by implementing a `com.matter.casting.support.DataSource`: ```java @@ -146,16 +146,16 @@ client's lifecycle: ``` 2. **Commissioning Data** - This object contains the passcode, discriminator, - etc which identify the app and are provided to the CastingPlayer during the - commissioning process. Refer to the Matter specification's + etc which identify the app and are provided to the `CastingPlayer` during + the commissioning process. Refer to the Matter specification's [Onboarding Payload](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/qr_code/OnboardingPayload.adoc#ref_OnboardingPayload) section for details on commissioning data. On Linux, define a function `InitCommissionableDataProvider` to initialize initialize a `LinuxCommissionableDataProvider` that can provide the required - values to the CastingApp. + values to the `CastingApp`. - ```c++ + ```c CHIP_ERROR InitCommissionableDataProvider(LinuxCommissionableDataProvider & provider, LinuxDeviceOptions & options) { chip::Optional setupPasscode; @@ -179,7 +179,7 @@ client's lifecycle: ``` On Android, define a `commissioningDataProvider` that can provide the - required values to the CastingApp. + required values to the `CastingApp`. ```java private static final DataProvider commissionableDataProvider = @@ -270,7 +270,7 @@ client's lifecycle: `castingAppDidReceiveRequestForDeviceAttestationCredentials` and `didReceiveRequestToSignCertificateRequest` to the `MTRAppParametersDataSource` class defined above, that can return - MTRDeviceAttestationCredentials and sign messages for the Casting Client, + `MTRDeviceAttestationCredentials` and sign messages for the Casting Client, respectively. ```objectivec @@ -312,12 +312,12 @@ initialize the Casting App as described below. Note: When you initialize the Casting client, make sure your code initializes it only once, before it starts a Matter casting session. -On Linux, create an AppParameters object using the +On Linux, create an `AppParameters` object using the `RotatingDeviceIdUniqueIdProvider`, `LinuxCommissionableDataProvider`, `CommonCaseDeviceServerInitParamsProvider`, `ExampleDACProvider` and `DefaultDACVerifier`, and call `CastingApp::GetInstance()->Initialize` with it. -```c++ +```c LinuxCommissionableDataProvider gCommissionableDataProvider; int main(int argc, char * argv[]) { // Create AppParameters that need to be passed to CastingApp.Initialize() @@ -351,7 +351,7 @@ int main(int argc, char * argv[]) { } ``` -On Android, create an AppParameters object using the +On Android, create an `AppParameters` object using the `rotatingDeviceIdUniqueIdProvider`, `commissioningDataProvider`, `dacProvider` and `DataProvider`, and call `CastingApp.getInstance().initialize` with it. @@ -408,13 +408,13 @@ func initialize() -> MatterError { _{Complete Discovery examples: [Linux](linux/simple-app.cpp)}_ The Casting Client discovers `CastingPlayers` using Matter Commissioner -discovery over DNS-SD by listening for CastingPlayer events as they are +discovery over DNS-SD by listening for `CastingPlayer` events as they are discovered, updated, or lost from the network. On Linux, define a `DiscoveryDelegateImpl` that implements the `matter::casting::core::DiscoveryDelegate`. -```c++ +```c class DiscoveryDelegateImpl : public DiscoveryDelegate { private: int commissionersCount = 0; @@ -439,11 +439,11 @@ public: Finally, register these listeners and start discovery. On Linux, register an instance of the `DiscoveryDelegateImpl` with -`matter::casting::core::CastingPlayerDiscovery` by calling SetDelegate on its +`matter::casting::core::CastingPlayerDiscovery` by calling `SetDelegate` on its singleton instance. Then, call `StartDiscovery` by optionally specifying the `kTargetPlayerDeviceType` to filter results by. -```c++ +```c DiscoveryDelegateImpl delegate; CastingPlayerDiscovery::GetInstance()->SetDelegate(&delegate); VerifyOrReturnValue(err == CHIP_NO_ERROR, 0,