Skip to content

Commit

Permalink
Pull request project-chip#624: Direct Internet connectivity integration
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from feature/DIC_integeration to silabs

Squashed commit of the following:

commit f59e2b8e23b6c8eda8b4a354c9cf1fde13b7f94e
Author: thirupathi <[email protected]>
Date:   Wed Apr 12 00:54:08 2023 +0530

    Direct Internet Connectivity integration
  • Loading branch information
Thirsrin authored and jmartinez-silabs committed Jan 24, 2024
1 parent 1a0dd34 commit 3d377df
Show file tree
Hide file tree
Showing 60 changed files with 20,254 additions and 0 deletions.
48 changes: 48 additions & 0 deletions examples/platform/silabs/DIC/matter_abs_interface/include/dic.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* @file
* @brief Matter abstraction layer for Direct Internet Connectivity.
*******************************************************************************
* # License
* <b>Copyright 2020 Silicon Laboratories Inc.
*www.silabs.com</b>
*******************************************************************************
*
* The licensor of this software is Silicon
*Laboratories Inc. Your use of this software is
*governed by the terms of Silicon Labs Master
*Software License Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement.
*This software is distributed to you in Source Code
*format and is governed by the sections of the MSLA
*applicable to Source Code.
*
******************************************************************************/

#ifndef __DIC_H
#define __DIC_H

#ifdef __cplusplus
extern "C" {
#endif
#include "stdint.h"

typedef enum {
DIC_OK = 0,
DIC_ERR_INVAL,
DIC_ERR_MEM,
DIC_ERR_FAIL,
} dic_err_t;

typedef struct {
uint8_t *dataP;
uint16_t dataLen;
} dic_buff_t;

dic_err_t DIC_Init(void);

dic_err_t DIC_SendMsg(const char *subject, dic_buff_t *content);

#ifdef __cplusplus
}
#endif
#endif //__DIC_H
183 changes: 183 additions & 0 deletions examples/platform/silabs/DIC/matter_abs_interface/include/dic_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
/**
* @file
* @brief Matter abstraction layer for Direct Internet Connectivity.
*******************************************************************************
* # License
* <b>Copyright 2020 Silicon Laboratories Inc.
*www.silabs.com</b>
*******************************************************************************
*
* The licensor of this software is Silicon
*Laboratories Inc. Your use of this software is
*governed by the terms of Silicon Labs Master
*Software License Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement.
*This software is distributed to you in Source Code
*format and is governed by the sections of the MSLA
*applicable to Source Code.
*
******************************************************************************/

#ifndef __DIC_CONFIG_H
#define __DIC_CONFIG_H

/*certificates*/
#define USE_AWS 1
#define USE_MOSQUITTO 0
#define USE_AZURE 0

/* Task Configuration*/
#define DIC_TASK_NAME "DIC"
#define DIC_TASK_STACK_SIZE (2*1024) //2k

/* Network Configuration*/
#define DIC_SERVER_HOST "a2m21kovu9tcsh-ats.iot.ap-southeast-1.amazonaws.com"
#define DIC_SERVER_PORT 8883
#define DIC_SERVER_CA_CERT ca_certificate
#define DIC_DEVICE_CERT device_certificate
#define DIC_DEVICE_KEY device_key

#define DIC_KEEP_ALIVE 0

#if USE_AWS

#define DIC_CLIENT_ID "DIC_2"
#define DIC_CLIENT_USER NULL
#define DIC_CLIENT_PASS NULL

char ca_certificate[] = "-----BEGIN CERTIFICATE-----\n"
"MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n"
"ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n"
"b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\n"
"MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n"
"b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n"
"ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n"
"9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n"
"IFAGbHrQg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BhMCSU4xEjAQBgNVBAgMCVRlbGFuZ2Fu\n"
"YTEMMAoGA1UEBwwDSHlkMQ8wDQYDVQQKDAZTaWxhYnMxDzANBgNVBAsMBm1hdHRl\n"
"cjEPMA0GA1UEAwwGY2hhbmR1MRwwGgYJKoZIhvcNAQkBFg1zaEBzaWxhYnMuY29t\n"
"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWIaIixoLW8k3JFROV0Uy+ja2Awhv\n"
"TnYXuuogAqbMsCsNB2kix3zIU6d8uYM/0QjVGBo3NT5S32BlvKa1aHaD+TAKBggq\n"
"hkjOPQQDAgNHADBEAiAMm4+cD3en9qYFHnRpl0YmVlj2bWpJ+VSDRlkUru2JdgIg\n"
"CLtDL0HQ9NZt+AwKGYwnBZwJLOMuBWczU4uCcXsFGUM=\n"
"-----END CERTIFICATE-----";

char device_key[] = "------BEGIN EC PRIVATE KEY-----\n"
"MHcCAQEEIFuiGwgW2Xj8QC+SO9LXNf9v6aSb+1vqAstp2h+dUArzoAoGCCqGSM49\n"
"AwEHoUQDQgAEWIaIixoLW8k3JFROV0Uy+ja2AwhvTnYXuuogAqbMsCsNB2kix3zI\n"
"U6d8uYM/0QjVGBo3NT5S32BlvKa1aHaD+Q==\n"
"-----END EC PRIVATE KEY-----";

#elif USE_MOSQUITTO

#define DIC_CLIENT_ID "test_client"
#define DIC_CLIENT_USER "explorer1"
#define DIC_CLIENT_PASS "p@ssw0rd"

char ca_certificate[] = "-----BEGIN CERTIFICATE-----\n"
"MIIDizCCAnOgAwIBAgIUHSLE8e28d9aCpdIyjFsL4hBhRuswDQYJKoZIhvcNAQEL\n"
"BQAwVTELMAkGA1UEBhMCSU4xCzAJBgNVBAgMAktBMQswCQYDVQQHDAJCQTELMAkG\n"
"A1UECgwCQ0cxCzAJBgNVBAsMAklEMRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMjMw\n"
"MjIwMTMwODEyWhcNMjgwMjIwMTMwODEyWjBVMQswCQYDVQQGEw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----END CERTIFICATE-----";

char device_certificate[] = "-----BEGIN CERTIFICATE-----\n"
"MIIBpzCCAU0CFAyhZKv2UJYX/5sFRapbXcMnWLZIMAoGCCqGSM49BAMCMFUxCzAJ\n"
"BgNVBAYTAklOMQswCQYDVQQIDAJLQTELMAkGA1UEBwwCQkExCzAJBgNVBAoMAkNH\n"
"MQswCQYDVQQLDAJDRTESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIzMDEyNTA2NDMw\n"
"NVoXDTI0MDEyMDA2NDMwNVowVzELMAkGA1UEBhMCSU4xCzAJBgNVBAgMAktBMQsw\n"
"CQYDVQQHDAJCQTELMAkGA1UECgwCQ0cxCzAJBgNVBAsMAklEMRQwEgYDVQQDDAtt\n"
"cXR0LWNsaWVudDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABKOGGPfEgSpQotAE\n"
"u8lI8hkZEPS8qiqDAyaYZnyd6Qg2LsTzpU1KFwzUgIZQPuFJNnsoP8nSDlh/9/5E\n"
"NiqddLcwCgYIKoZIzj0EAwIDSAAwRQIhAIDQzIW+lRYPUzEHAcYDK8cuqdzFzgKN\n"
"Ye6O46Os34GDAiBt/ODIHL3yTYd3uyBGMk0NGolFnd6L3o/Sv7OZHgsESw==\n"
"-----END CERTIFICATE-----";

char device_key[] = "-----BEGIN EC PRIVATE KEY-----\n"
"MHcCAQEEIGdTdbc0E7+VQEjU17tPPB4jgX3sbz0oKPzoobcFtZimoAoGCCqGSM49\n"
"AwEHoUQDQgAEo4YY98SBKlCi0AS7yUjyGRkQ9LyqKoMDJphmfJ3pCDYuxPOlTUoX\n"
"DNSAhlA+4Uk2eyg/ydIOWH/3/kQ2Kp10tw==\n"
"-----END EC PRIVATE KEY-----";

#elif USE_AZURE

#define DIC_CLIENT_ID "explorer"
#define DIC_CLIENT_USER "SilabsAzureIOT.azure-devices.net/explorer"
#define DIC_CLIENT_PASS NULL

char ca_certificate[] = "-----BEGIN CERTIFICATE-----\n"
"MIIDdzCCAl+gAwIBAgI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Cr0\n"
"Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz\n"
"ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS\n"
"R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp\n"
"-----END CERTIFICATE-----";

char device_certificate[] = "-----BEGIN CERTIFICATE-----\n"
"MIIBpTCCAUoCFAKvmMEFCTORIRRXqRVa77vDvnU7MAoGCCqGSM49BAMCMFUxCzAJ\n"
"BgNVBAYTAklOMQswCQYDVQQIDAJLQTELMAkGA1UEBwwCQkExCzAJBgNVBAoMAkNH\n"
"MQswCQYDVQQLDAJDRTESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIzMDIwNzA4MDMz\n"
"NVoXDTI0MDIwMjA4MDMzNVowVDELMAkGA1UEBhMCSU4xCzAJBgNVBAgMAktBMQsw\n"
"CQYDVQQHDAJCQTELMAkGA1UECgwCQ0cxCzAJBgNVBAsMAklEMREwDwYDVQQDDAhl\n"
"eHBsb3JlcjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABKOGGPfEgSpQotAEu8lI\n"
"8hkZEPS8qiqDAyaYZnyd6Qg2LsTzpU1KFwzUgIZQPuFJNnsoP8nSDlh/9/5ENiqd\n"
"dLcwCgYIKoZIzj0EAwIDSQAwRgIhAPJy5MVJ9NYO8YvI8+fq0NTOFRYa1lZ9wz99\n"
"oQw2HvoNAiEAp6EkfIrWy+YS5Y852YUAOE4cT+maDnueMjp12SAS+jI=\n"
"-----END CERTIFICATE-----";

char device_key[] = "-----BEGIN EC PRIVATE KEY-----\n"
"MHcCAQEEIGdTdbc0E7+VQEjU17tPPB4jgX3sbz0oKPzoobcFtZimoAoGCCqGSM49\n"
"AwEHoUQDQgAEo4YY98SBKlCi0AS7yUjyGRkQ9LyqKoMDJphmfJ3pCDYuxPOlTUoX\n"
"DNSAhlA+4Uk2eyg/ydIOWH/3/kQ2Kp10tw==\n"
"-----END EC PRIVATE KEY-----";

#endif //for certificates

#endif // __DIC_CONFIG_H
Loading

0 comments on commit 3d377df

Please sign in to comment.