Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into develop-add-littlefs
  • Loading branch information
josesimoes committed Jul 15, 2024
2 parents 68789da + ed6918d commit 806d478
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 18 deletions.
2 changes: 1 addition & 1 deletion targets/ESP32/_IDF/sdkconfig.default.esp32c6
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH=y
CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=n
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n
CONFIG_MBEDTLS_HAVE_TIME_DATE=y
CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=n
CONFIG_MBEDTLS_DES_C=y
CONFIG_MBEDTLS_XTEA_C=y
CONFIG_MBEDTLS_PEM_WRITE_C=n
CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI=n

CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y
CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ static const CLR_RT_MethodHandler method_lookup[] =
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
Library_net_thread_native_nanoFramework_Networking_Thread_OpenThread::NativeCreateStack___VOID,
Library_net_thread_native_nanoFramework_Networking_Thread_OpenThread::NativeSetActiveDataset___VOID,
Library_net_thread_native_nanoFramework_Networking_Thread_OpenThread::NativeGetActiveDataset___VOID,
Expand Down Expand Up @@ -82,12 +90,14 @@ static const CLR_RT_MethodHandler method_lookup[] =
NULL,
NULL,
NULL,
NULL,
NULL,
};

const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Networking_Thread =
{
"nanoFramework.Networking.Thread",
0xBFBB09A8,
0x4EF1F92D,
method_lookup,
{ 1, 0, 0, 0 }
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ typedef enum __nfpack ThreadDeviceRole

typedef enum __nfpack ThreadDeviceState
{
ThreadDeviceState_OPENTHREAD_EVENT_START = 0,
ThreadDeviceState_OPENTHREAD_EVENT_STOP = 1,
ThreadDeviceState_OPENTHREAD_EVENT_DETACHED = 2,
ThreadDeviceState_OPENTHREAD_EVENT_ATTACHED = 3,
ThreadDeviceState_OPENTHREAD_EVENT_IF_UP = 5,
ThreadDeviceState_OPENTHREAD_EVENT_IF_DOWN = 6,
ThreadDeviceState_OPENTHREAD_EVENT_GOT_IP6 = 7,
ThreadDeviceState_Start = 0,
ThreadDeviceState_Stop = 1,
ThreadDeviceState_Detached = 2,
ThreadDeviceState_Attached = 3,
ThreadDeviceState_InterfaceUp = 5,
ThreadDeviceState_InterfaceDown = 6,
ThreadDeviceState_GotIpv6 = 7,
} ThreadDeviceState;

typedef enum __nfpack ThreadDeviceType
Expand All @@ -66,22 +66,22 @@ typedef enum __nfpack ThreadDeviceType

struct Library_net_thread_native_nanoFramework_Networking_Thread_OpenThreadStateChangeEventArgs
{
static const int FIELD__currentState = 3;
static const int FIELD___currentState = 3;

//--//
};

struct Library_net_thread_native_nanoFramework_Networking_Thread_OpenThreadRoleChangeEventArgs
{
static const int FIELD__previousRole = 3;
static const int FIELD__currentRole = 4;
static const int FIELD___previousRole = 3;
static const int FIELD___currentRole = 4;

//--//
};

struct Library_net_thread_native_nanoFramework_Networking_Thread_OpenThreadConsoleOutputAvailableArgs
{
static const int FIELD__consoleLines = 3;
static const int FIELD___consoleLines = 3;

//--//
};
Expand Down Expand Up @@ -136,7 +136,7 @@ struct Library_net_thread_native_nanoFramework_Networking_Thread_OpenThreadDatas

struct Library_net_thread_native_nanoFramework_Networking_Thread_OpenThreadJoinerStartCompleteEventArgs
{
static const int FIELD__error = 3;
static const int FIELD___error = 3;

//--//
};
Expand Down
Binary file modified targets/netcore/nanoFramework.nanoCLR.CLI/License/vspt.vsptlic
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
using System.Reflection;
using System.Text.RegularExpressions;

// TODO: Add IsInstalled method that does the following:
// A) Get the guid from SerialPortLibraryClass
// B) Checks registry for the existence of the library ex: HKEY_CLASSES_ROOT\CLSID\{e13da62c-3a88-45a4-a5d0-224dea7bf4ff}
// TODO: Check license AFTER confirming installation so a more specific error can be displayed
namespace nanoFramework.nanoCLR.CLI
{
public class VirtualSerialDeviceManager
Expand Down Expand Up @@ -190,16 +194,26 @@ private void InstallLicense()
{
var assembly = typeof(VirtualSerialDeviceManager).GetTypeInfo().Assembly;

Stream resource = assembly.GetManifestResourceStream(_licenseResourceName);
MemoryStream memoryStream = new MemoryStream();
using var resource = assembly.GetManifestResourceStream(_licenseResourceName);
if (resource is null)
{
// TODO: Should probably return an error
return;
}

using var memoryStream = new MemoryStream();

resource.CopyTo(memoryStream);
var bytes = memoryStream.ToArray();

if (bytes.Length > 0)
if (bytes.Length <= 0)
{
_serialPortLibrary.installLicenseInMemory(bytes);
// TODO: Should probably return an error
return;
}

// This appears to be a misleading name as the license appears to be persisted
_serialPortLibrary.installLicenseInMemory(bytes);
}
}
}

0 comments on commit 806d478

Please sign in to comment.