takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers address_read_and_write.py Source File

address_read_and_write.py

00001 """
00002 Copyright (c) 2017, Arm Limited and affiliates.
00003 SPDX-License-Identifier: Apache-2.0
00004 
00005 Licensed under the Apache License, Version 2.0 (the "License");
00006 you may not use this file except in compliance with the License.
00007 You may obtain a copy of the License at
00008 
00009     http://www.apache.org/licenses/LICENSE-2.0
00010 
00011 Unless required by applicable law or agreed to in writing, software
00012 distributed under the License is distributed on an "AS IS" BASIS,
00013 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 See the License for the specific language governing permissions and
00015 limitations under the License.
00016 """
00017 
00018 import os,sys
00019 from icetea_lib.bench import Bench
00020 
00021 class Testcase(Bench):
00022     def __init__(self):
00023         Bench.__init__(self, name = "address_read_and_write",
00024                         title = "MAC address and PAN id read/write test",
00025                         status = "development",
00026                         type = "smoke",
00027                         subtype = "",
00028                         execution = {
00029                             "skip": {
00030                                 "value": False,
00031                                 "reason": ""
00032                             }
00033                         },
00034                         author = "Valtteri Erkkila",
00035                         purpose = "Tests reading a MAC address from the driver, and writing to the modifiable MAC address",
00036                         feature = ["MLME-SET"],
00037                         component = ["MAC"],
00038                         requirements = {
00039                             "duts": {
00040                                 '*': {
00041                                     "count":1,
00042                                     "type": "hardware",
00043                                     "allowed_platforms": ["K64F", "K66F", "NUCLEO_F429ZI", "KW24D", "UBLOX_EVK_ODIN_W2"],
00044                                     "application": {
00045                                        "name": "TEST_APPS-device-nanostack_mac_tester"
00046                                     }
00047                                 },
00048                                 "1":{"nick": "First"}
00049                         }}
00050         )
00051 
00052     def setUp(self):
00053         pass
00054 
00055     def case(self):
00056         self.command("First", "addr")
00057         self.command("First", "addr --64-bit 01:02:03:00:00:00:00:01")
00058         self.command("First", "addr --16-bit 0xABCD")
00059         #macPANId
00060         self.command("First", "mlme-set --attr 0x50 --value_bytes CD:CD --value_size 2")
00061         self.command("First", "addr")
00062         self.verify_trace(1, "MAC64: 01:02:03:00:00:00:00:01")
00063 
00064     def tearDown(self):
00065         self.reset_dut()