
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
@arm-software/vscode-cmsis-csolution
Advanced tools
API for the Arm.cmsis-csolution VS Code extension
This API provides other VSCode extensions access to a subset of functionality implemented by the CMSIS Solution Extension, such as querying available boards, devices, and project drafts, as well as creating new solutions and triggering build tasks.
Example for getting access to the API v2 from another extension:
import type { CsolutionExtension } from '@arm-software/vscode-cmsis-csolution';
const csolutionExtension = vscode.extensions.getExtension<CsolutionExtension>('Arm.cmsis-csolution');
if (csolutionExtension) {
const api = (await csolutionExtension.activate()).getApi(2);
// use api calls as described below
}
The API version 2 provides a more streamlined and efficient way to interact with the CMSIS components, making it easier to integrate and utilize these features in other extensions.
This function allows you to query the available boards based on optional filter arguments. It returns a list of boards that match the specified criteria, providing detailed information about each board, including its vendor, name, revision, and associated packs.
Example:
const filter: BoardFilter = { /* optional filter arguments */};
const boards = await api.getBoards(filter); // BoardData[]
console.log(`Available boards (${boards.length}):`);
for (board of boards) {
const pack = await board.pack;
let packId = ''
if (pack) {
let packVersion = ''
if (pack.version) {
packVersion = `@${pack.version}`
}
packId = ` (${pack.vendor}::${pack.name}${packVersion})`
}
console.log(` - ${board.vendor}::${board.name}:${board.rev ?? ''}${packId}`)
}
Similar to querying boards, this function allows you to query the available devices based on optional filter arguments. It returns a list of devices that match the specified criteria, providing detailed information about each device, including its vendor, name, and associated packs.
Example:
const filter: DeviceFilter = { /* optional filter arguments */};
const devices = await api.getDevices(filter); // DeviceData[]
console.log(`Available devices (${devices.length}):`);
for (device of devices) {
const pack = await device.pack;
let packId = ''
if (pack) {
let packVersion = ''
if (pack.version) {
packVersion = `@${pack.version}`
}
packId = ` (${device.pack.vendor}::${device.pack.name}${packVersion})`
}
console.log(` - ${device.vendor}::${device.name}${packId}`)
}
Retrieve a list of available project drafts for a selected board and/or device. This function helps you identify and select project drafts that are compatible with the specified hardware, providing a convenient way to kickstart new projects.
Example:
const boardId = boardData.id; // retrieved by api.getBoards()
const deviceId = deviceData.id; // retrieved by api.getDevices()
const drafts = await api.getDraftProjects(boardId, deviceId); // DraftProjectData[]
console.log(`Available project drafts (${drafts.length}):`);
for (draft of drafts) {
const pack = draft.pack;
let packId = ''
if (pack) {
let packVersion = ''
if (pack.version) {
packVersion = `@${pack.version}`
}
packId = ` (${pack.vendor}::${pack.name}${packVersion})`
}
console.log(` - ${draft.name}${packId}`)
}
This function allows you to create a new solution from a selected project draft. It copies the project draft into the specified folder, adapts it for the given board and device, and opens it in a new instance of the code editor. This streamlines the process of setting up new projects, ensuring that all necessary configurations are in place.
Example:
const board = boardData; // retrieved by api.getBoards()
const device = deviceData; // retrieved by api.getDevices()
const draft = draftProjectData; // retrieved by api.getDraftProjects()
const projectOptions : CreateNewSolutionOptions = {
draft, board, device,
folder: '/path/for/new/solution',
};
await api.createNewSolution(projectOptions);
Build, rebuild, or clean tasks can be triggered via the API. This function allows you to specify options such as
--updateRte
and --packs
command line flags to cbuild, providing flexibility in how build tasks are executed. This
is useful for automating the build process and ensuring that all necessary dependencies and configurations are up to
date.
Example:
const buildOptions: CsolutionApiV2.BuildOptions = {
clean: false, // --clean
rebuild: false, // --rebuild
updateRte: false, // --update-rte
packs: false // --packs
};
await api.build(buildOptions);
The API version 1 is broken and deprecated and should not be used any longer.
The following calls changed their behavior.
The APIv1::getBoards()
call now returns only boards found in locally installed packs instead of all indexed packs.
Consider using APIv2::getBoards()
instead.
The APIv1::getDevices()
call now returns only devices found in locally installed packs instead of all indexed packs.
Consider using APIv2::getDevices()
instead.
FAQs
API for the Arm.cmsis-csolution VS Code extension
The npm package @arm-software/vscode-cmsis-csolution receives a total of 8 weekly downloads. As such, @arm-software/vscode-cmsis-csolution popularity was classified as not popular.
We found that @arm-software/vscode-cmsis-csolution demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.