
A board support package for the LPC4088 Display Module.
Dependencies: DM_HttpServer DM_USBHost
Dependents: lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more
Fork of DMSupport by
Registry.cpp@40:6df4f63aa406, 2015-06-10 (annotated)
- Committer:
- alindvall
- Date:
- Wed Jun 10 09:54:15 2015 +0000
- Revision:
- 40:6df4f63aa406
- Parent:
- 37:07659b5d90ce
- Child:
- 41:e06e764ff4fd
Updated USBDevice, mbed-src and mbed-rtos libraries to latest version. Fixed compiler errors related to us_ticker_read() that was introduced in latest mbed-src version.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 20:9df19da50290 | 1 | /* |
embeddedartists | 20:9df19da50290 | 2 | * Copyright 2014 Embedded Artists AB |
embeddedartists | 20:9df19da50290 | 3 | * |
embeddedartists | 20:9df19da50290 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
embeddedartists | 20:9df19da50290 | 5 | * you may not use this file except in compliance with the License. |
embeddedartists | 20:9df19da50290 | 6 | * You may obtain a copy of the License at |
embeddedartists | 20:9df19da50290 | 7 | * |
embeddedartists | 20:9df19da50290 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
embeddedartists | 20:9df19da50290 | 9 | * |
embeddedartists | 20:9df19da50290 | 10 | * Unless required by applicable law or agreed to in writing, software |
embeddedartists | 20:9df19da50290 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
embeddedartists | 20:9df19da50290 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
embeddedartists | 20:9df19da50290 | 13 | * See the License for the specific language governing permissions and |
embeddedartists | 20:9df19da50290 | 14 | * limitations under the License. |
embeddedartists | 20:9df19da50290 | 15 | */ |
embeddedartists | 20:9df19da50290 | 16 | |
embeddedartists | 20:9df19da50290 | 17 | #include "mbed.h" |
embeddedartists | 20:9df19da50290 | 18 | #include "DMBoard.h" |
embeddedartists | 20:9df19da50290 | 19 | #include "InternalEEPROM.h" |
embeddedartists | 20:9df19da50290 | 20 | #include "Registry.h" |
embeddedartists | 20:9df19da50290 | 21 | |
embeddedartists | 20:9df19da50290 | 22 | |
embeddedartists | 20:9df19da50290 | 23 | /****************************************************************************** |
embeddedartists | 20:9df19da50290 | 24 | * Defines and typedefs |
embeddedartists | 20:9df19da50290 | 25 | *****************************************************************************/ |
embeddedartists | 20:9df19da50290 | 26 | |
embeddedartists | 20:9df19da50290 | 27 | //Registry::Entry::Entry(const char* key, const char* value, bool free) : |
embeddedartists | 20:9df19da50290 | 28 | // _key(key),_value(value),_freeKey(free),_freeValue(free) |
embeddedartists | 20:9df19da50290 | 29 | //{ |
embeddedartists | 20:9df19da50290 | 30 | //} |
embeddedartists | 20:9df19da50290 | 31 | // |
embeddedartists | 20:9df19da50290 | 32 | //Registry::Entry::~Entry() |
embeddedartists | 20:9df19da50290 | 33 | //{ |
embeddedartists | 20:9df19da50290 | 34 | // if (_freeKey && _key != NULL) { |
embeddedartists | 20:9df19da50290 | 35 | // free((void*)_key); |
embeddedartists | 20:9df19da50290 | 36 | // _key = NULL; |
embeddedartists | 20:9df19da50290 | 37 | // } |
embeddedartists | 20:9df19da50290 | 38 | //} |
embeddedartists | 20:9df19da50290 | 39 | // |
embeddedartists | 20:9df19da50290 | 40 | //void Registry::Entry::modify(const char* newValue) |
embeddedartists | 20:9df19da50290 | 41 | //{ |
embeddedartists | 20:9df19da50290 | 42 | // if (_freeValue && _value != NULL) { |
embeddedartists | 20:9df19da50290 | 43 | // free((void*)_value); |
embeddedartists | 20:9df19da50290 | 44 | // _value = NULL; |
embeddedartists | 20:9df19da50290 | 45 | // } |
embeddedartists | 20:9df19da50290 | 46 | // _freeValue = true; |
embeddedartists | 20:9df19da50290 | 47 | // _value = newValue; |
embeddedartists | 20:9df19da50290 | 48 | //} |
embeddedartists | 20:9df19da50290 | 49 | |
embeddedartists | 20:9df19da50290 | 50 | /****************************************************************************** |
embeddedartists | 20:9df19da50290 | 51 | * Local variables |
embeddedartists | 20:9df19da50290 | 52 | *****************************************************************************/ |
embeddedartists | 20:9df19da50290 | 53 | |
embeddedartists | 20:9df19da50290 | 54 | /****************************************************************************** |
embeddedartists | 20:9df19da50290 | 55 | * Private Class |
embeddedartists | 20:9df19da50290 | 56 | *****************************************************************************/ |
embeddedartists | 20:9df19da50290 | 57 | |
embeddedartists | 20:9df19da50290 | 58 | /****************************************************************************** |
embeddedartists | 20:9df19da50290 | 59 | * Private Functions |
embeddedartists | 20:9df19da50290 | 60 | *****************************************************************************/ |
embeddedartists | 20:9df19da50290 | 61 | |
embeddedartists | 20:9df19da50290 | 62 | Registry::Registry() : _numEntries(0), _entries(NULL) |
embeddedartists | 20:9df19da50290 | 63 | { |
embeddedartists | 20:9df19da50290 | 64 | } |
embeddedartists | 20:9df19da50290 | 65 | |
embeddedartists | 20:9df19da50290 | 66 | Registry::~Registry() |
embeddedartists | 20:9df19da50290 | 67 | { |
embeddedartists | 20:9df19da50290 | 68 | if (_data != NULL) { |
embeddedartists | 20:9df19da50290 | 69 | free(_data); |
embeddedartists | 20:9df19da50290 | 70 | _data = NULL; |
embeddedartists | 20:9df19da50290 | 71 | } |
embeddedartists | 20:9df19da50290 | 72 | _numEntries = 0; |
embeddedartists | 20:9df19da50290 | 73 | _entries = NULL; |
embeddedartists | 20:9df19da50290 | 74 | } |
embeddedartists | 20:9df19da50290 | 75 | |
embeddedartists | 20:9df19da50290 | 76 | Registry::RegistryError Registry::fromEEPROM() |
embeddedartists | 20:9df19da50290 | 77 | { |
embeddedartists | 20:9df19da50290 | 78 | // Registry is stored as a header followed by a nuber of key-value |
embeddedartists | 20:9df19da50290 | 79 | // pairs. Each key and value is a maximum of 31 characters + null |
embeddedartists | 20:9df19da50290 | 80 | // termination. The header looks like this: |
embeddedartists | 20:9df19da50290 | 81 | // |
embeddedartists | 20:9df19da50290 | 82 | // key = 'e','a','r','e','g','\0' |
embeddedartists | 20:9df19da50290 | 83 | // val = X |
embeddedartists | 20:9df19da50290 | 84 | // |
embeddedartists | 20:9df19da50290 | 85 | // where X is the number of key-value pairs used (one byte). |
embeddedartists | 20:9df19da50290 | 86 | // The list is compacted so that there are no unused entries in |
embeddedartists | 20:9df19da50290 | 87 | // the list. |
embeddedartists | 20:9df19da50290 | 88 | // |
embeddedartists | 20:9df19da50290 | 89 | _entries = (reg_entry_t*)_data; |
embeddedartists | 20:9df19da50290 | 90 | _numEntries = _entries[0].val[0]; |
embeddedartists | 20:9df19da50290 | 91 | for (int i = 0; i < NumEntries; i++) { |
embeddedartists | 20:9df19da50290 | 92 | _modified[i] = false; |
embeddedartists | 20:9df19da50290 | 93 | } |
embeddedartists | 20:9df19da50290 | 94 | |
embeddedartists | 20:9df19da50290 | 95 | // Check header entry |
embeddedartists | 20:9df19da50290 | 96 | if (strcmp(_entries[0].key, "eareg") == 0) { |
embeddedartists | 20:9df19da50290 | 97 | |
embeddedartists | 20:9df19da50290 | 98 | // Check num entries |
embeddedartists | 20:9df19da50290 | 99 | if (_numEntries < NumEntries) { |
embeddedartists | 20:9df19da50290 | 100 | |
embeddedartists | 20:9df19da50290 | 101 | // list is valid, but make sure null termination is ok |
embeddedartists | 20:9df19da50290 | 102 | // just in case |
embeddedartists | 20:9df19da50290 | 103 | for (int i = 1; i <= _numEntries; i++) { |
embeddedartists | 20:9df19da50290 | 104 | _entries[i].key[EntryLen-1] = '\0'; |
embeddedartists | 20:9df19da50290 | 105 | _entries[i].val[EntryLen-1] = '\0'; |
embeddedartists | 20:9df19da50290 | 106 | } |
embeddedartists | 20:9df19da50290 | 107 | |
embeddedartists | 20:9df19da50290 | 108 | return Ok; |
embeddedartists | 20:9df19da50290 | 109 | } |
embeddedartists | 20:9df19da50290 | 110 | } |
embeddedartists | 20:9df19da50290 | 111 | |
embeddedartists | 20:9df19da50290 | 112 | // The list is either corrupt or doesn't exist, create one |
embeddedartists | 20:9df19da50290 | 113 | memset(_data, 0, NumEntries*sizeof(reg_entry_t)); |
embeddedartists | 20:9df19da50290 | 114 | sprintf(_entries[0].key, "eareg"); |
embeddedartists | 20:9df19da50290 | 115 | _entries[0].val[0] = _numEntries = 0; |
embeddedartists | 20:9df19da50290 | 116 | _modified[0] = true; |
embeddedartists | 20:9df19da50290 | 117 | |
embeddedartists | 20:9df19da50290 | 118 | return Ok; |
embeddedartists | 20:9df19da50290 | 119 | } |
embeddedartists | 20:9df19da50290 | 120 | |
embeddedartists | 20:9df19da50290 | 121 | Registry::RegistryError Registry::toEEPROM() |
embeddedartists | 20:9df19da50290 | 122 | { |
embeddedartists | 20:9df19da50290 | 123 | if (_entries[0].val[0] != _numEntries) { |
embeddedartists | 20:9df19da50290 | 124 | _entries[0].val[0] = _numEntries; |
embeddedartists | 20:9df19da50290 | 125 | _modified[0] = true; |
embeddedartists | 20:9df19da50290 | 126 | } |
embeddedartists | 20:9df19da50290 | 127 | return Ok; |
embeddedartists | 20:9df19da50290 | 128 | } |
embeddedartists | 20:9df19da50290 | 129 | |
embeddedartists | 20:9df19da50290 | 130 | int Registry::find(const char* key) |
embeddedartists | 20:9df19da50290 | 131 | { |
embeddedartists | 20:9df19da50290 | 132 | for (int i = 1; i <= _numEntries; i++) { |
embeddedartists | 20:9df19da50290 | 133 | if (strcmp(key, _entries[i].key) == 0) { |
embeddedartists | 20:9df19da50290 | 134 | return i; |
embeddedartists | 20:9df19da50290 | 135 | } |
embeddedartists | 20:9df19da50290 | 136 | } |
embeddedartists | 20:9df19da50290 | 137 | return -1; |
embeddedartists | 20:9df19da50290 | 138 | } |
embeddedartists | 20:9df19da50290 | 139 | |
embeddedartists | 20:9df19da50290 | 140 | /****************************************************************************** |
embeddedartists | 20:9df19da50290 | 141 | * Public Functions |
embeddedartists | 20:9df19da50290 | 142 | *****************************************************************************/ |
embeddedartists | 20:9df19da50290 | 143 | |
embeddedartists | 20:9df19da50290 | 144 | Registry::RegistryError Registry::load() |
embeddedartists | 20:9df19da50290 | 145 | { |
embeddedartists | 20:9df19da50290 | 146 | InternalEEPROM eeprom; |
embeddedartists | 20:9df19da50290 | 147 | RegistryError err = Ok; |
embeddedartists | 20:9df19da50290 | 148 | |
embeddedartists | 20:9df19da50290 | 149 | _mutex.lock(); |
embeddedartists | 20:9df19da50290 | 150 | if (_data != NULL) { |
embeddedartists | 20:9df19da50290 | 151 | free(_data); |
embeddedartists | 20:9df19da50290 | 152 | _data = NULL; |
embeddedartists | 20:9df19da50290 | 153 | } |
embeddedartists | 20:9df19da50290 | 154 | _numEntries = 0; |
embeddedartists | 20:9df19da50290 | 155 | _entries = NULL; |
embeddedartists | 20:9df19da50290 | 156 | |
embeddedartists | 20:9df19da50290 | 157 | do { |
embeddedartists | 20:9df19da50290 | 158 | eeprom.init(); |
embeddedartists | 20:9df19da50290 | 159 | |
embeddedartists | 20:9df19da50290 | 160 | _data = (uint8_t*)malloc(eeprom.memorySize()); |
embeddedartists | 20:9df19da50290 | 161 | if (_data == NULL) { |
embeddedartists | 20:9df19da50290 | 162 | err = MemoryError; |
embeddedartists | 20:9df19da50290 | 163 | break; |
embeddedartists | 20:9df19da50290 | 164 | } |
embeddedartists | 20:9df19da50290 | 165 | |
embeddedartists | 29:b1ec19000e15 | 166 | uint32_t read = eeprom.read(0,_data,eeprom.memorySize()); |
embeddedartists | 20:9df19da50290 | 167 | if (read != eeprom.memorySize()) { |
embeddedartists | 20:9df19da50290 | 168 | err = EEPROMReadError; |
embeddedartists | 20:9df19da50290 | 169 | break; |
embeddedartists | 20:9df19da50290 | 170 | } |
embeddedartists | 20:9df19da50290 | 171 | |
embeddedartists | 20:9df19da50290 | 172 | eeprom.powerDown(); |
embeddedartists | 20:9df19da50290 | 173 | |
embeddedartists | 20:9df19da50290 | 174 | // decode the data |
embeddedartists | 20:9df19da50290 | 175 | err = fromEEPROM(); |
embeddedartists | 20:9df19da50290 | 176 | if (err != Ok) { |
embeddedartists | 20:9df19da50290 | 177 | free(_data); |
embeddedartists | 20:9df19da50290 | 178 | _data = NULL; |
embeddedartists | 20:9df19da50290 | 179 | } |
embeddedartists | 20:9df19da50290 | 180 | |
embeddedartists | 20:9df19da50290 | 181 | } while(0); |
embeddedartists | 20:9df19da50290 | 182 | |
embeddedartists | 20:9df19da50290 | 183 | _mutex.unlock(); |
embeddedartists | 20:9df19da50290 | 184 | return err; |
embeddedartists | 20:9df19da50290 | 185 | } |
embeddedartists | 20:9df19da50290 | 186 | |
embeddedartists | 20:9df19da50290 | 187 | Registry::RegistryError Registry::setValue(const char* key, const char* val) |
embeddedartists | 20:9df19da50290 | 188 | { |
embeddedartists | 20:9df19da50290 | 189 | RegistryError err = Ok; |
embeddedartists | 20:9df19da50290 | 190 | _mutex.lock(); |
embeddedartists | 20:9df19da50290 | 191 | int existingIdx = find(key); |
embeddedartists | 20:9df19da50290 | 192 | if (existingIdx == -1) { |
embeddedartists | 20:9df19da50290 | 193 | // new value |
embeddedartists | 20:9df19da50290 | 194 | if (_numEntries < (NumEntries-1)) { |
embeddedartists | 20:9df19da50290 | 195 | // room for more |
embeddedartists | 20:9df19da50290 | 196 | if (strlen(key) < EntryLen) { |
embeddedartists | 20:9df19da50290 | 197 | if (strlen(val) < EntryLen) { |
embeddedartists | 20:9df19da50290 | 198 | _numEntries++; |
embeddedartists | 20:9df19da50290 | 199 | strncpy(_entries[_numEntries].key, key, EntryLen-1); |
embeddedartists | 20:9df19da50290 | 200 | strncpy(_entries[_numEntries].val, val, EntryLen-1); |
embeddedartists | 20:9df19da50290 | 201 | _modified[_numEntries] = true; |
embeddedartists | 20:9df19da50290 | 202 | } else { |
embeddedartists | 20:9df19da50290 | 203 | err = ValueLenError; |
embeddedartists | 20:9df19da50290 | 204 | } |
embeddedartists | 20:9df19da50290 | 205 | } else { |
embeddedartists | 20:9df19da50290 | 206 | err = KeyLenError; |
embeddedartists | 20:9df19da50290 | 207 | } |
embeddedartists | 20:9df19da50290 | 208 | } else { |
embeddedartists | 20:9df19da50290 | 209 | err = RegistryFullError; |
embeddedartists | 20:9df19da50290 | 210 | } |
embeddedartists | 20:9df19da50290 | 211 | } else { |
embeddedartists | 20:9df19da50290 | 212 | // already have value, modify it |
embeddedartists | 20:9df19da50290 | 213 | if (strlen(val) < EntryLen) { |
embeddedartists | 20:9df19da50290 | 214 | strncpy(_entries[existingIdx].val, val, EntryLen-1); |
embeddedartists | 20:9df19da50290 | 215 | _modified[existingIdx] = true; |
embeddedartists | 20:9df19da50290 | 216 | } else { |
embeddedartists | 20:9df19da50290 | 217 | err = ValueLenError; |
embeddedartists | 20:9df19da50290 | 218 | } |
embeddedartists | 20:9df19da50290 | 219 | } |
embeddedartists | 20:9df19da50290 | 220 | _mutex.unlock(); |
embeddedartists | 20:9df19da50290 | 221 | return err; |
embeddedartists | 20:9df19da50290 | 222 | } |
embeddedartists | 20:9df19da50290 | 223 | |
embeddedartists | 20:9df19da50290 | 224 | Registry::RegistryError Registry::getValue(const char* key, char** pVal) |
embeddedartists | 20:9df19da50290 | 225 | { |
embeddedartists | 20:9df19da50290 | 226 | RegistryError err = Ok; |
embeddedartists | 20:9df19da50290 | 227 | _mutex.lock(); |
embeddedartists | 20:9df19da50290 | 228 | int existingIdx = find(key); |
embeddedartists | 20:9df19da50290 | 229 | if (existingIdx == -1) { |
embeddedartists | 20:9df19da50290 | 230 | *pVal = NULL; |
embeddedartists | 20:9df19da50290 | 231 | err = NoSuchKeyError; |
embeddedartists | 20:9df19da50290 | 232 | } else { |
embeddedartists | 20:9df19da50290 | 233 | *pVal = (char*)malloc(EntryLen); |
embeddedartists | 20:9df19da50290 | 234 | if (*pVal == NULL) { |
embeddedartists | 20:9df19da50290 | 235 | err = MemoryError; |
embeddedartists | 20:9df19da50290 | 236 | } else { |
embeddedartists | 20:9df19da50290 | 237 | strncpy(*pVal, _entries[existingIdx].val, EntryLen); |
embeddedartists | 20:9df19da50290 | 238 | } |
embeddedartists | 20:9df19da50290 | 239 | } |
embeddedartists | 20:9df19da50290 | 240 | _mutex.unlock(); |
embeddedartists | 20:9df19da50290 | 241 | return err; |
embeddedartists | 20:9df19da50290 | 242 | } |
embeddedartists | 20:9df19da50290 | 243 | |
embeddedartists | 20:9df19da50290 | 244 | Registry::RegistryError Registry::entryAt(int pos, char** pKey, char** pVal) |
embeddedartists | 20:9df19da50290 | 245 | { |
embeddedartists | 20:9df19da50290 | 246 | RegistryError err = Ok; |
embeddedartists | 20:9df19da50290 | 247 | _mutex.lock(); |
embeddedartists | 20:9df19da50290 | 248 | if (pos < 0 || pos >= NumEntries) { |
embeddedartists | 20:9df19da50290 | 249 | err = InvalidPositionError; |
embeddedartists | 20:9df19da50290 | 250 | } else { |
embeddedartists | 20:9df19da50290 | 251 | *pKey = (char*)malloc(EntryLen); |
embeddedartists | 20:9df19da50290 | 252 | if (*pKey == NULL) { |
embeddedartists | 20:9df19da50290 | 253 | err = MemoryError; |
embeddedartists | 20:9df19da50290 | 254 | } else { |
embeddedartists | 20:9df19da50290 | 255 | strncpy(*pKey, _entries[pos+1].key, EntryLen); |
embeddedartists | 20:9df19da50290 | 256 | *pVal = (char*)malloc(EntryLen); |
embeddedartists | 20:9df19da50290 | 257 | if (*pVal == NULL) { |
embeddedartists | 20:9df19da50290 | 258 | err = MemoryError; |
embeddedartists | 20:9df19da50290 | 259 | free(*pKey); |
embeddedartists | 20:9df19da50290 | 260 | *pKey = NULL; |
embeddedartists | 20:9df19da50290 | 261 | } else { |
embeddedartists | 20:9df19da50290 | 262 | strncpy(*pVal, _entries[pos+1].val, EntryLen); |
embeddedartists | 20:9df19da50290 | 263 | } |
embeddedartists | 20:9df19da50290 | 264 | } |
embeddedartists | 20:9df19da50290 | 265 | } |
embeddedartists | 20:9df19da50290 | 266 | _mutex.unlock(); |
embeddedartists | 20:9df19da50290 | 267 | return err; |
embeddedartists | 20:9df19da50290 | 268 | } |
embeddedartists | 20:9df19da50290 | 269 | |
embeddedartists | 20:9df19da50290 | 270 | |
embeddedartists | 20:9df19da50290 | 271 | Registry::RegistryError Registry::registerListener() |
embeddedartists | 20:9df19da50290 | 272 | { |
embeddedartists | 20:9df19da50290 | 273 | return Ok; |
embeddedartists | 20:9df19da50290 | 274 | } |
embeddedartists | 20:9df19da50290 | 275 | |
embeddedartists | 20:9df19da50290 | 276 | Registry::RegistryError Registry::store() |
embeddedartists | 20:9df19da50290 | 277 | { |
embeddedartists | 20:9df19da50290 | 278 | InternalEEPROM eeprom; |
embeddedartists | 20:9df19da50290 | 279 | RegistryError err = Ok; |
embeddedartists | 20:9df19da50290 | 280 | |
embeddedartists | 20:9df19da50290 | 281 | _mutex.lock(); |
embeddedartists | 20:9df19da50290 | 282 | |
embeddedartists | 20:9df19da50290 | 283 | do { |
embeddedartists | 20:9df19da50290 | 284 | err = toEEPROM(); |
embeddedartists | 20:9df19da50290 | 285 | if (err != Ok) { |
embeddedartists | 20:9df19da50290 | 286 | break; |
embeddedartists | 20:9df19da50290 | 287 | } |
embeddedartists | 20:9df19da50290 | 288 | |
embeddedartists | 20:9df19da50290 | 289 | eeprom.init(); |
embeddedartists | 20:9df19da50290 | 290 | |
embeddedartists | 20:9df19da50290 | 291 | for (int i = 0; i <= _numEntries; i++) { |
embeddedartists | 20:9df19da50290 | 292 | if (_modified[i]) { |
embeddedartists | 20:9df19da50290 | 293 | if (eeprom.write(i*EntrySize, (uint8_t*)&_entries[i], EntrySize) != EntrySize) { |
embeddedartists | 20:9df19da50290 | 294 | err = EEPROMWriteError; |
embeddedartists | 20:9df19da50290 | 295 | break; |
embeddedartists | 20:9df19da50290 | 296 | } |
alindvall | 37:07659b5d90ce | 297 | _modified[i] = false; |
embeddedartists | 20:9df19da50290 | 298 | } |
embeddedartists | 20:9df19da50290 | 299 | } |
embeddedartists | 20:9df19da50290 | 300 | |
embeddedartists | 20:9df19da50290 | 301 | eeprom.powerDown(); |
embeddedartists | 20:9df19da50290 | 302 | |
embeddedartists | 20:9df19da50290 | 303 | } while(0); |
embeddedartists | 20:9df19da50290 | 304 | |
embeddedartists | 20:9df19da50290 | 305 | _mutex.unlock(); |
embeddedartists | 20:9df19da50290 | 306 | |
embeddedartists | 20:9df19da50290 | 307 | return err; |
embeddedartists | 20:9df19da50290 | 308 | } |