Skip to content

Commit

Permalink
Improve package filtering (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Nov 29, 2021
1 parent 351240a commit 7f0975f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 40 deletions.
37 changes: 1 addition & 36 deletions nanoFirmwareFlasher/FirmwarePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,43 +77,8 @@ public static List<CloudSmithPackageDetail> GetTargetList(
SupportedPlatform? platform,
VerbosityLevel verbosity)
{
string queryFilter = string.Empty;

// build query filter according to platform using package name
if (platform != null)
{
List<string> query = new();

switch(platform)
{
case SupportedPlatform.esp32:
query.Add("ESP");
query.Add("M5");
query.Add("FEATHER");
query.Add("KALUGA");
break;

case SupportedPlatform.stm32:
query.Add("ST");
query.Add("ORGPAL");
query.Add("NETDUINO3");
query.Add("QUAIL");
query.Add("GHI");
query.Add("IngenuityMicro");
query.Add("WeAct");
query.Add("Pyb");
break;

case SupportedPlatform.cc13x2:
query.Add("TI");
break;
}

queryFilter = string.Join(" OR ", query.Select(t => $"name:{t}"));
}

string repoName = communityTargets ? _communityTargetsRepo : preview ? _refTargetsDevRepo : _refTargetsStableRepo;
string requestUri = $"{_cloudsmithPackages}/{repoName}/?query={queryFilter}";
string requestUri = $"{_cloudsmithPackages}/{repoName}/?tag={platform}";
List<CloudSmithPackageDetail> targetPackages = new();

if (verbosity > VerbosityLevel.Normal)
Expand Down
2 changes: 1 addition & 1 deletion nanoFirmwareFlasher/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,6 @@ public enum SupportedPlatform
{
esp32 = 0,
stm32 = 1,
cc13x2 = 2
ti_simplelink = 2
}
}
6 changes: 3 additions & 3 deletions nanoFirmwareFlasher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o)
)
{
// candidates for TI CC13x2
o.Platform = SupportedPlatform.cc13x2;
o.Platform = SupportedPlatform.ti_simplelink;
}
else
{
Expand Down Expand Up @@ -302,7 +302,7 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o)
// drivers install
else if (o.TIInstallXdsDrivers)
{
o.Platform = SupportedPlatform.cc13x2;
o.Platform = SupportedPlatform.ti_simplelink;
}
else if (
o.InstallDfuDrivers
Expand Down Expand Up @@ -905,7 +905,7 @@ static async Task RunOptionsAndReturnExitCodeAsync(Options o)

#region TI CC13x2 platform options

if (o.Platform == SupportedPlatform.cc13x2)
if (o.Platform == SupportedPlatform.ti_simplelink)
{
if (o.TIInstallXdsDrivers)
{
Expand Down

0 comments on commit 7f0975f

Please sign in to comment.