takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers send_data.py Source File

send_data.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 = "send_data",
00024                         title = "Simple data transmission 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 that sending data works",
00036                         feature = ["MCPS-DATA"],
00037                         component = ["MAC"],
00038                         requirements = {
00039                             "duts": {
00040                                 '*': {
00041                                     "count":2,
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                                 "2":{"nick": "Second"}
00050                         }}
00051         )
00052 
00053     def setUp(self):
00054         self.channel = 11
00055         self.command("First", "addr --64-bit 01:02:03:00:00:00:00:01")
00056         self.command("Second", "addr --64-bit 01:02:03:00:00:00:00:02")
00057 
00058     def case(self):
00059         self.command("First", "start --pan_coordinator true --logical_channel {}".format(self.channel))
00060         self.command("Second", "start --pan_coordinator false --logical_channel {}".format(self.channel))
00061 
00062         self.command("First", "data --dst_addr 01:02:03:00:00:00:00:02 --msdu_length 5 --msdu abcde")
00063         self.command("Second", "data --dst_addr 01:02:03:00:00:00:00:01 --msdu_length 5 --msdu 12345")
00064 
00065     def tearDown(self):
00066         self.reset_dut()