THIS REPO IS CURRENTLY IN PREVIEW. THE APIs ARE NOT FINAL AND ARE SUBJECT TO CHANGE WITHOUT NOTICE. Azure utility library used in embedded and constrained devices.
Перейти к файлу
Justin Gosses a5687316f7
Update README.md
2024-05-30 16:09:55 -05:00
.github customize doc scripts for ulib (#78) 2021-08-13 14:25:27 -07:00
build_all Update pipeline agents (#85) 2021-10-28 09:12:50 -07:00
cmake-modules Replace test infrastructure from umock-c to cmocka. (#62) 2021-03-19 14:58:32 -07:00
config Add Registry to data persistence between resets. (#84) 2021-11-03 08:36:21 -07:00
deps Does not use siglongjmp for cmocka in embedded devices. (#86) 2021-11-09 13:02:08 -08:00
docs Add Core library. (#57) 2021-02-03 15:35:53 -08:00
inc Add Registry to data persistence between resets. (#84) 2021-11-03 08:36:21 -07:00
pal Add Registry to data persistence between resets. (#84) 2021-11-03 08:36:21 -07:00
samples Add Registry to data persistence between resets. (#84) 2021-11-03 08:36:21 -07:00
src Add Registry to data persistence between resets. (#84) 2021-11-03 08:36:21 -07:00
tests Add Registry to data persistence between resets. (#84) 2021-11-03 08:36:21 -07:00
.clang-format Change clang-format to fit the SDK guidelines, and reformat the code. (#58) 2021-02-04 08:20:28 -08:00
.gitignore Enable pedantic mode for errors and warnings. (#65) 2021-04-01 12:00:11 -07:00
.gitmodules Replace test infrastructure from umock-c to cmocka. (#62) 2021-03-19 14:58:32 -07:00
CMakeLists.txt Add Registry to data persistence between resets. (#84) 2021-11-03 08:36:21 -07:00
CMakeSettings.json Change IPC to use the new try_get_interface schema. (#83) 2021-10-06 11:48:31 -07:00
LICENSE
README.md Update README.md 2024-05-30 16:09:55 -05:00
SECURITY.md Adding Microsoft SECURITY.MD (#87) 2023-01-30 16:31:35 -05:00

README.md

This repository has been archived due to sustained lack of activity as noted in issue: https://github.com/Azure/azure-ulib-c/issues/89

Azure uLib C - PREVIEW

Build Status

THIS REPO IS CURRENTLY IN PREVIEW. THE API'S ARE NOT FINAL AND ARE SUBJECT TO CHANGE WITHOUT NOTICE.

The intention of this repository is to provide developers useful tools to make developing for small, limited-resource devices easier.

This repository contains the following:

  • uStream: avoid copying memory and expose large amounts of data without using a large amount of memory. Samples can be found here.

Table of Contents

Documentation

We use doxygen to generate documentation for source code. You can find the generated, versioned documentation here.

The GitHub Repository

To get help with the uLib:

Structure

This repo is structured with two priorities:

  1. Separation of services/features to make it easier to find relevant information and resources.
  2. Simplified source file structuring to easily integrate features into a user's project.

    /docs - documentation for each service (iot, etc)
    /inc - include directory - can be singularly included in your project to resolve all headers
    /samples - samples for each service
    /src - source files for each service
    /tests - tests for each service

For instructions on how to consume the libraries via CMake, please see here. For instructions on how consume the source code in an IDE, command line, or other build systems, please see here.

Master Branch

The master branch has the most recent code with new features and bug fixes. This repo is under construction, so it does not represent the General Availability (GA) release of the uLib.

Release Branches and Release Tagging

When we make an official release, we will create a unique git tag containing the name and version to mark the commit. We'll use this tag for servicing via hotfix branches as well as debugging the code for a particular beta or stable release version.

Getting Started Using the uLib

The uLib can be conveniently consumed either via CMake or other non-CMake methods (IDE workspaces, command line, and others).

CMake

  1. Install the required prerequisites:

    • CMake version 3.10 or later
    • C compiler: MSVC, gcc or clang are recommended
    • git to clone our Azure uLib repository with the desired tag
  2. Clone our Azure uLib repository, optionally using the desired version tag.

     git clone https://github.com/Azure/azure-ulib-c --recursive
    
  3. Ensure the uLib builds correctly.

    • Create an output directory for your build artifacts (in this example, we named it build, but you can pick any name).
        mkdir build
      
    • Navigate to that newly created directory.
        cd build
      
    • Run cmake pointing to the sources at the root of the repo to generate the builds files.
        cmake ..
      
    • Launch the underlying build system to compile the libraries.
        cmake --build .
      

    This results in building uLib as a static library file, placed in the output directory you created. It creates a few samples in that you can directly run from the samples directory.

CMake Options

By default, when building the project with no options, the following static libraries are generated:

  • Libraries:
    • az_core
      • az_span, az_http, az_json, etc.
    • azure_ulib_c
      • az_ustream, az_ipc, etc.

The following CMake options are available for adding/removing project features.

Option Description Default Value
UNIT_TESTING Generates Unit Test for compilation. When turning this option ON, cmocka is a required dependency for compilation.
After Compiling, use `ctest` to run Unit Test.
OFF
PRECONDITIONS Turning this option OFF would remove all method contracts. This is typically for shipping libraries for production to make it as optimized as possible. ON
LOGGING Build uLib with logging support using Azure Core Library's AZ_LOG. ON
SKIP_SAMPLES When turning ON, the compiler will not build the samples. OFF

For example:

  • to build uLib with samples and test

      cmake .. -DUNIT_TESTING:BOOL=ON
    
  • to build clean uLib

      cmake .. -DSKIP_SAMPLES:BOOL=ON -DPRECONDITIONS:BOOL=OFF
    

Development Environment

Project contains files to work on Windows, Mac or Linux based OS.

Note For any environment variables set to use with CMake, the environment variables must be set BEFORE the first cmake generation command (cmake ..). The environment variables will NOT be picked up if you have already generated the build files, set environment variables, and then regenerate. In that case, you must either delete the CMakeCache.txt file or delete the folder in which you are generating build files and start again.

Creating Your Own uStream

Using the specification listed here in the documentation, you can create your own implementation of a ustream. In order to ensure that it behaves according to the specification, we have created tests which you can run against your implementation. You can use ustream_ut_sample.c and ustream_e2e_sample.c in tests_sample as a reference. TODO's have been placed in the sample files to help guide what you need to implement.

Contributing

For details on contributing to this repository, see the contributing guide.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Reporting Security Issues and Security Bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

License

Azure uLib C is licensed under the MIT license.